From be59c3615fd25d9c82c31903eec4c75285352a7a Mon Sep 17 00:00:00 2001 From: Lakhan Samani Date: Tue, 14 Jun 2022 15:47:08 +0530 Subject: [PATCH] fix: add comment for scope --- server/handlers/oauth_login.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/handlers/oauth_login.go b/server/handlers/oauth_login.go index 57df41d..235d794 100644 --- a/server/handlers/oauth_login.go +++ b/server/handlers/oauth_login.go @@ -184,8 +184,9 @@ func OAuthLoginHandler() gin.HandlerFunc { return } 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=openid name email" + // there is scope encoding issue with oauth2 and how apple expects, hence added scope manually + // check: https://github.com/golang/oauth2/issues/449 + url := oauth.OAuthProviders.AppleConfig.AuthCodeURL(oauthStateString, oauth2.SetAuthURLParam("response_mode", "form_post")) + "&scope=name email" c.Redirect(http.StatusTemporaryRedirect, url) default: log.Debug("Invalid oauth provider: ", provider)