Skip to content

Commit

Permalink
ADD dump info for RefreshOAuthToken.
Browse files Browse the repository at this point in the history
  • Loading branch information
karminski committed Nov 1, 2023
1 parent 54b7352 commit e1795b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/controller/resource_peripheral.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (controller *Controller) RefreshGoogleSheetsOAuth(c *gin.Context) {
controller.FeedbackBadRequest(c, ERROR_FLAG_CAN_NOT_REFRESH_GOOGLE_SHEETS, "fresh google sheets oauth token error: "+errInRefreshOAuthToken.Error())
return
}
fmt.Printf("[DUMP] RefreshGoogleSheetsOAuth.resourceOptionGoogleSheets: %+v\n", refreshTokenResponse)
fmt.Printf("[DUMP] RefreshGoogleSheetsOAuth.refreshTokenResponse: %+v\n", refreshTokenResponse)

resourceOptionGoogleSheets.SetAccessToken(refreshTokenResponse.ExportAccessToken())
resource.UpdateGoogleSheetOAuth2Options(userID, resourceOptionGoogleSheets)
Expand Down
3 changes: 3 additions & 0 deletions src/utils/oauthgoogle/oauth_google.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package oauthgoogle

import (
"encoding/json"
"fmt"

"github.com/go-resty/resty/v2"
"github.com/illacloud/builder-backend/src/utils/config"
Expand Down Expand Up @@ -88,6 +89,8 @@ func RefreshOAuthToken(refreshToken string) (*RefreshTokenResponse, error) {
if resp.IsError() {
return nil, errInPost
}
fmt.Printf("[DUMP] RefreshOAuthToken.resp:%+v\n", resp)
fmt.Printf("[DUMP] RefreshOAuthToken.resp.Body():%+v\n", string(resp.Body()))
// unmarshal
refreshTokenResponse := NewRefreshTokenResponse()
errInUnmarshal := json.Unmarshal(resp.Body(), &refreshTokenResponse)
Expand Down

0 comments on commit e1795b0

Please sign in to comment.