Skip to content

Commit

Permalink
fix: missing id error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed Dec 16, 2024
1 parent d4f672e commit 0acde67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SocialiteProviders/src/NFDIAAI/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ protected function getUserByToken($token)
*/
protected function mapUserToObject(array $user)
{
dd($user);
if (!isset($user['id']) || empty($user['id'])) {
throw new InvalidArgumentException('The user data is invalid: a unique "id" is required.');
}

return (new User)->setRaw($user)->map([
'id' => $user['id'],
'nickname' => $user['username'],
Expand Down

0 comments on commit 0acde67

Please sign in to comment.