fix: update scope for apple login

This commit is contained in:
Lakhan Samani 2022-06-14 13:11:39 +05:30
parent 395e2e2a85
commit fadd9f6168
2 changed files with 5 additions and 2 deletions

View File

@ -499,8 +499,11 @@ func processAppleUserInfo(code string) (models.User, error) {
} }
if val, ok := claims["name"]; ok { if val, ok := claims["name"]; ok {
givenName := val.(string) nameData := val.(map[string]interface{})
givenName := nameData["firstName"].(string)
familyName := nameData["lastName"].(string)
user.GivenName = &givenName user.GivenName = &givenName
user.FamilyName = &familyName
} }
return user, err return user, err

View File

@ -130,7 +130,7 @@ func InitOAuth() error {
AuthURL: "https://appleid.apple.com/auth/authorize", AuthURL: "https://appleid.apple.com/auth/authorize",
TokenURL: "https://appleid.apple.com/auth/token", TokenURL: "https://appleid.apple.com/auth/token",
}, },
Scopes: []string{"name", "email"}, Scopes: []string{"openid", "name", "email"},
} }
} }