From 91c29c40924ff436ccaf0eed445e2ccd07e9df4d Mon Sep 17 00:00:00 2001 From: Lakhan Samani Date: Tue, 14 Jun 2022 15:43:23 +0530 Subject: [PATCH] fix: redirect --- server/handlers/oauth_callback.go | 2 +- server/handlers/oauth_login.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/handlers/oauth_callback.go b/server/handlers/oauth_callback.go index 36681b2..22efe43 100644 --- a/server/handlers/oauth_callback.go +++ b/server/handlers/oauth_callback.go @@ -225,7 +225,7 @@ func OAuthCallbackHandler() gin.HandlerFunc { redirectURL = redirectURL + "?" + strings.TrimPrefix(params, "&") } - c.Redirect(http.StatusTemporaryRedirect, redirectURL) + c.Redirect(http.StatusFound, redirectURL) } } diff --git a/server/handlers/oauth_login.go b/server/handlers/oauth_login.go index 0ec8784..57df41d 100644 --- a/server/handlers/oauth_login.go +++ b/server/handlers/oauth_login.go @@ -185,7 +185,7 @@ func OAuthLoginHandler() gin.HandlerFunc { } oauth.OAuthProviders.AppleConfig.RedirectURL = hostname + "/oauth_callback/" + constants.SignupMethodApple // Scope from the root config was not passed for apple login - url := oauth.OAuthProviders.AppleConfig.AuthCodeURL(oauthStateString, oauth2.SetAuthURLParam("response_mode", "form_post")) + "&scope=name email" + url := oauth.OAuthProviders.AppleConfig.AuthCodeURL(oauthStateString, oauth2.SetAuthURLParam("response_mode", "form_post")) + "&scope=openid name email" c.Redirect(http.StatusTemporaryRedirect, url) default: log.Debug("Invalid oauth provider: ", provider)