From b7ea73b3c24060582abd79fee9f2b7dbd2d39140 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Thu, 27 Apr 2023 23:59:12 +0800 Subject: [PATCH] fix(aliyundrive_open): can't refresh token if access_token is empty (#4255) --- drivers/aliyundrive_open/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/aliyundrive_open/util.go b/drivers/aliyundrive_open/util.go index 55e2b27c..68e455d2 100644 --- a/drivers/aliyundrive_open/util.go +++ b/drivers/aliyundrive_open/util.go @@ -65,7 +65,7 @@ func (d *AliyundriveOpen) request(uri, method string, callback base.ReqCallback, } isRetry := len(retry) > 0 && retry[0] if e.Code != "" { - if !isRetry && e.Code == "AccessTokenInvalid" { + if !isRetry && (utils.SliceContains([]string{"AccessTokenInvalid", "AccessTokenExpired", "I400JD"}, e.Code) || d.AccessToken == "") { err = d.refreshToken() if err != nil { return nil, err