Skip to content

Commit

Permalink
Fix socialite provider (#176)
Browse files Browse the repository at this point in the history
* Fix socialite provider

* styleCI

* styleCI

* styleCI

* styleCI

* styleCI
  • Loading branch information
hermesdj authored Feb 16, 2024
1 parent 09d8b55 commit 756ed09
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/Socialite/EveOnline/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of SeAT
*
* Copyright (C) 2015 to 2022 Leon Jacobs
* Copyright (C) 2015 to present Leon Jacobs
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -94,13 +94,13 @@ protected function mapUserToObject(array $user)
}

return (new User)->setRaw($user)->map([
'id' => $character_id,
'name' => $user['name'],
'nickname' => $user['name'],
'id' => $character_id,
'name' => $user['name'],
'nickname' => $user['name'],
'character_owner_hash' => $user['owner'],
'scopes' => is_array($user['scp']) ? $user['scp'] : [$user['scp']],
'expires_on' => $user['exp'],
'avatar' => $avatar,
'scopes' => is_array($user['scp']) ? $user['scp'] : [$user['scp']],
'expires_on' => $user['exp'],
'avatar' => $avatar,
]);
}

Expand All @@ -112,7 +112,17 @@ protected function mapUserToObject(array $user)
*/
protected function getTokenFields($code)
{
return array_merge(parent::getTokenFields($code), ['grant_type' => 'authorization_code']);
$fields = [
'grant_type' => 'authorization_code',
'code' => $code,
'redirect_uri' => $this->redirectUrl,
];

if ($this->usesPKCE()) {
$fields['code_verifier'] = $this->request->session()->pull('code_verifier');
}

return $fields;
}

/**
Expand Down

0 comments on commit 756ed09

Please sign in to comment.