Skip to content

Conversation

jjchen01
Copy link
Collaborator

  • Centralize AccessTokenExpirationDuration and RefreshTokenExpirationDuration in one location.
  • Remove test endpoint
  • Remove unnecessary code.

Comment on lines -199 to -208
// Use handleGoogleToken to calculate expiration with buffer
// Instead of hardcoded 15 minutes, the access token now uses the actual expiration time from Google's token response
accessTokenExp, err := handleGoogleToken(tokenResp)
if err != nil {
reqCtx.AbortWithStatusJSON(http.StatusInternalServerError, responses.ErrorResponse{
Code: "c6d6bafd-b9f3-4ebb-9c90-a21b07308ebc",
Error: err.Error(),
})
return
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary code and misleading comments, token from the third party has been verified in:

verifier := googleAuthAPI.oidcProvider.Verifier(&oidc.Config{ClientID: googleAuthAPI.oAuth2Config.ClientID})
	idToken, err := verifier.Verify(reqCtx, rawIDToken)
	if err != nil {
		reqCtx.AbortWithStatusJSON(http.StatusBadRequest, responses.ErrorResponse{
			Code:  "8ea31139-211e-4282-82de-9664814e6f46",
			Error: err.Error(),
		})
		return
	}

Copy link
Contributor

@locnguyen1986 locnguyen1986 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jjchen01 jjchen01 merged commit 2c8313c into main Sep 17, 2025
1 check passed
@jjchen01 jjchen01 deleted the feat/google-oauth-redirect branch September 17, 2025 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants