socialite
This commit is contained in:
@@ -84,24 +84,38 @@ class LoginController extends Controller
|
|||||||
'character_id' => auth()->user()->getId(),
|
'character_id' => auth()->user()->getId(),
|
||||||
])->get(['scope']);
|
])->get(['scope']);
|
||||||
|
|
||||||
|
//Pop each scope onto the array of scopes
|
||||||
foreach($extraScopes as $extra) {
|
foreach($extraScopes as $extra) {
|
||||||
array_push($scopes, $extra->scope);
|
array_push($scopes, $extra->scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
//array_push($scopes, $extraScopes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Place the scopes in the session to verify later after the redirect
|
//Place the scopes in the session to verify later after the redirect
|
||||||
//has been completed and a token is received
|
//has been completed and a token is received
|
||||||
session()->put('scopes', $scopes);
|
session()->put('scopes', $scopes);
|
||||||
|
|
||||||
dd($scopes);
|
|
||||||
|
|
||||||
return $social->driver('eveonline')
|
return $social->driver('eveonline')
|
||||||
->scopes($scopes)
|
->scopes($scopes)
|
||||||
->redirect();
|
->redirect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redirect to the provider's website
|
||||||
|
*
|
||||||
|
* @return Socialite
|
||||||
|
*/
|
||||||
|
public function redirectToProviderAlt($profile = null, Socialite $social) {
|
||||||
|
//The default scope is public data for everyone due to the OAuth2 Token
|
||||||
|
$scopes = ['publicData'];
|
||||||
|
|
||||||
|
//Let's put some information in the session to designate this is an alt call
|
||||||
|
session()->put('altCall', true);
|
||||||
|
|
||||||
|
return $social->driver('eveonline')
|
||||||
|
->scopes($scopes)
|
||||||
|
->redirect();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get token from callback
|
* Get token from callback
|
||||||
* Redirect to the dashboard if logging in successfully.
|
* Redirect to the dashboard if logging in successfully.
|
||||||
@@ -137,6 +151,9 @@ class LoginController extends Controller
|
|||||||
//Redirect to the dashboard with the correct message
|
//Redirect to the dashboard with the correct message
|
||||||
return redirect()->to('/dashboard')->with('success', 'Successfully updated ESI Scopes.');
|
return redirect()->to('/dashboard')->with('success', 'Successfully updated ESI Scopes.');
|
||||||
} else {
|
} else {
|
||||||
|
//Retrieve the session data for altCall, and delete it from the session
|
||||||
|
$alt = session()->pull('altCall');
|
||||||
|
|
||||||
if($this->createAlt($ssoUser)) {
|
if($this->createAlt($ssoUser)) {
|
||||||
return redirect()->to('/profile')->with('success', 'Alt registered.');
|
return redirect()->to('/profile')->with('success', 'Alt registered.');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user