Merge branch 'rj' into 'main'

added refreshtoken to callback params

See merge request psa/uess/authn!5
This commit is contained in:
2026-03-12 13:33:46 +08:00
+6 -1
View File
@@ -326,7 +326,12 @@ func GoogleCallback(w http.ResponseWriter, r *http.Request) {
helper.LogInfo("Copy this access token: " + accessToken)
RedirectURL := fmt.Sprintf("%s/callback?token=%s&user_id=%s", redirectURI, accessToken, userID)
var RedirectURL string
if strings.Contains(redirectURI, "com.") { //Request from mobile; append refresh_token to query params
RedirectURL = fmt.Sprintf("%s/callback?token=%s&refresh_token=%s&user_id=%s", redirectURI, accessToken, refreshToken, userID)
}
RedirectURL = fmt.Sprintf("%s/callback?token=%s&user_id=%s", redirectURI, accessToken, userID)
http.Redirect(w, r, RedirectURL, http.StatusSeeOther)
}