Skip to content

Commit

Permalink
Included raw data for apple provider
Browse files Browse the repository at this point in the history
  • Loading branch information
althenlimzixuan committed May 27, 2024
1 parent 5f5686c commit 09cbb99
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions providers/apple/apple.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,25 @@ func (p Provider) FetchUser(session goth.Session) (goth.User, error) {
if s.AccessToken == "" {
return goth.User{}, fmt.Errorf("no access token obtained for session with provider %s", p.Name())
}

raw_data := make(map[string]interface{})

raw_data["access_token"] = s.AccessToken
raw_data["refresh_token"] = s.RefreshToken
raw_data["expires_at"] = s.ExpiresAt
raw_data["is_private_email"] = s.ID.IsPrivateEmail
raw_data["email_verified"] = s.ID.EmailVerified
raw_data["sub"] = s.ID.Sub
raw_data["email"] = s.ID.Email

return goth.User{
Provider: p.Name(),
UserID: s.ID.Sub,
Email: s.ID.Email,
AccessToken: s.AccessToken,
RefreshToken: s.RefreshToken,
ExpiresAt: s.ExpiresAt,
RawData: raw_data,
}, nil
}

Expand Down

0 comments on commit 09cbb99

Please sign in to comment.