Skip to content

Commit ad2182a

Browse files
authored
fix(auth): correctly map user in GitHub OAuth provider (#1751)
1 parent b787c16 commit ad2182a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/auth/src/OAuth/Config/GitHubOAuthConfig.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,16 @@ public function createProvider(): AbstractProvider
5959
*/
6060
public function mapUser(ObjectFactory $factory, ResourceOwnerInterface $resourceOwner): OAuthUser
6161
{
62+
$data = $resourceOwner->toArray();
63+
6264
return $factory->withData([
6365
'id' => (string) $resourceOwner->getId(),
6466
'email' => $resourceOwner->getEmail(),
6567
'name' => $resourceOwner->getName(),
6668
'nickname' => $resourceOwner->getNickname(),
6769
'avatar' => $data['avatar_url'] ?? null,
6870
'provider' => $this->provider,
69-
'raw' => $resourceOwner->toArray(),
71+
'raw' => $data,
7072
])->to(OAuthUser::class);
7173
}
7274
}

0 commit comments

Comments
 (0)