Skip to content

Commit

Permalink
Update VATSIM API Request Info (SocialiteProviders#1184)
Browse files Browse the repository at this point in the history
  • Loading branch information
vFlyingCowboy authored Jun 8, 2024
1 parent d9da594 commit 13cf89e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
14 changes: 11 additions & 3 deletions src/Vatsim/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,17 @@ protected function getUserByToken($token)
protected function mapUserToObject(array $user)
{
return (new User())->setRaw($user)->map([
'id' => Arr::get($user, 'data.cid'),
'name' => Arr::get($user, 'data.personal.name_full'),
'email' => Arr::get($user, 'data.personal.email'),
'cid' => Arr::get($user, 'data.cid'),
'first_name' => Arr::get($user, 'data.personal.name_first'),
'last_name' => Arr::get($user, 'data.personal.name_last'),
'full_name' => Arr::get($user, 'data.personal.name_full'),
'rating' => Arr::get($user, 'data.vatsim.rating.id'),
'pilot_rating' => Arr::get($user, 'data.vatsim.pilotrating.id'),
'region' => Arr::get($user, 'data.vatsim.region.id'),
'division' => Arr::get($user, 'data.vatsim.division.id'),
'subdivision' => Arr::get($user, 'data.vatsim.subdivision.id'),


]);
}

Expand Down
11 changes: 9 additions & 2 deletions src/Vatsim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ return Socialite::driver('vatsim')->requiredScopes(['email'])->redirect();

### Returned User fields

- ``id``
- ``name``
- ``cid``
- ``first_name``
- ``last_name``
- ``full_name``
- ``email``
- ``rating``
- ``pilotrating``
- ``region``
- ``division``
- ``subdivision``

0 comments on commit 13cf89e

Please sign in to comment.