From 7d1272d815cb9cac02d68f5d6403831b13ce4b34 Mon Sep 17 00:00:00 2001 From: Lakhan Samani Date: Tue, 14 Jun 2022 14:41:31 +0530 Subject: [PATCH] fix: update scope for apple login --- server/handlers/oauth_login.go | 2 +- server/oauth/oauth.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server/handlers/oauth_login.go b/server/handlers/oauth_login.go index aaee2a6..3641f7e 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"), oauth2.SetAuthURLParam("scope", "name email")) + url := oauth.OAuthProviders.AppleConfig.AuthCodeURL(oauthStateString, oauth2.SetAuthURLParam("response_mode", "form_post"), oauth2.SetAuthURLParam("scope", "name%20email")) c.Redirect(http.StatusTemporaryRedirect, url) default: log.Debug("Invalid oauth provider: ", provider) diff --git a/server/oauth/oauth.go b/server/oauth/oauth.go index 9172890..067a098 100644 --- a/server/oauth/oauth.go +++ b/server/oauth/oauth.go @@ -130,6 +130,7 @@ func InitOAuth() error { AuthURL: "https://appleid.apple.com/auth/authorize", TokenURL: "https://appleid.apple.com/auth/token", }, + Scopes: []string{"name%20email"}, } }