Skip to content

Commit

Permalink
chore(aliyundrive_open): print resp content on refresh token (close #…
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Aug 31, 2023
1 parent 34fadec commit dd10c0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/aliyundrive_open/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (d *AliyundriveOpen) _refreshToken() (string, string, error) {
//var resp base.TokenResp
var e ErrResp
res, err := base.RestyClient.R().
ForceContentType("application/json").
//ForceContentType("application/json").
SetBody(base.Json{
"client_id": d.ClientID,
"client_secret": d.ClientSecret,
Expand All @@ -45,7 +45,7 @@ func (d *AliyundriveOpen) _refreshToken() (string, string, error) {
}
refresh, access := utils.Json.Get(res.Body(), "refresh_token").ToString(), utils.Json.Get(res.Body(), "access_token").ToString()
if refresh == "" {
return "", "", errors.New("failed to refresh token: refresh token is empty")
return "", "", fmt.Errorf("failed to refresh token: refresh token is empty, resp: %s", res.String())
}
curSub, err := getSub(d.RefreshToken)
if err != nil {
Expand Down

0 comments on commit dd10c0c

Please sign in to comment.