Skip to content

Commit f3b9a43

Browse files
[Apple] Adding method to return SocialiteUser by JWT token (#962)
1 parent 4452556 commit f3b9a43

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Provider.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,23 @@ protected function getUserByToken($token)
117117
return json_decode(base64_decode($claims), true);
118118
}
119119

120+
/**
121+
* Return the user given the identity token provided on the client
122+
* side by Apple.
123+
*
124+
* @param string $token
125+
*
126+
* @throws InvalidStateException when token can't be parsed
127+
*
128+
* @return User $user
129+
*/
130+
public function userByIdentityToken(string $token): SocialiteUser
131+
{
132+
$array = $this->getUserByToken($token);
133+
134+
return $this->mapUserToObject($array);
135+
}
136+
120137
/**
121138
* Verify Apple jwt.
122139
*

0 commit comments

Comments
 (0)