oauth v2 token

This commit is contained in:
2021-02-12 04:56:52 +09:00
parent ac5ccadc55
commit cf1876e43f
2 changed files with 5 additions and 15 deletions

View File

@@ -84,7 +84,7 @@ class LoginController extends Controller
public function handleProviderCallback() {
//Get the sso user from the socialite driver
$ssoUser = Socialite::driver('eveonline')->user();
dd($ssoUser);
if(Auth::check()) {
//If a refresh token is present, then we are doing a scope callback
//to update scopes for an access token

View File

@@ -52,25 +52,15 @@ class EveOnlineOAuthProvider extends AbstractProvider implements ProviderInterfa
*/
protected function mapUserToObject(array $user) {
dd($user);
return (new User)->setRaw($user)->map([
'id' => $user['CharacterID'],
'name' => $user['CharacterName'],
'owner_hash' => $user['CharacterOwnerHash'],
'nickname' => $user['CharacterName'],
'character_owner_hash' => $user['CharacterOwnerHash'],
'avatar' => 'https://image.eveonline.com/Character/' . $user['CharacterID'] . '_128.jpg',
'token_type' => $user['TokenType'],
'expires_on' => $user['ExpiresOn'],
]);
/*
return (new User)->setRaw($user)->map([
'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,
]);
*/
}
/**