diff --git a/server/handlers/oauth_callback.go b/server/handlers/oauth_callback.go index 28a28d6..8b25618 100644 --- a/server/handlers/oauth_callback.go +++ b/server/handlers/oauth_callback.go @@ -499,8 +499,11 @@ func processAppleUserInfo(code string) (models.User, error) { } 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.FamilyName = &familyName } return user, err diff --git a/server/oauth/oauth.go b/server/oauth/oauth.go index cbfac89..a320d68 100644 --- a/server/oauth/oauth.go +++ b/server/oauth/oauth.go @@ -130,7 +130,7 @@ func InitOAuth() error { AuthURL: "https://appleid.apple.com/auth/authorize", TokenURL: "https://appleid.apple.com/auth/token", }, - Scopes: []string{"name", "email"}, + Scopes: []string{"openid", "name", "email"}, } }