socialite

This commit is contained in:
2021-02-12 18:20:57 +09:00
parent 6e7ec0564f
commit 0ce7d24f69
2 changed files with 40 additions and 63 deletions

View File

@@ -75,12 +75,21 @@ class LoginController extends Controller
* @return Socialite
*/
public function redirectToProvider($profile = null, Socialite $social) {
//The default scope is public data for everyone due to OAuth2 Tokens
$scopes = ['publicData'];
//Collect any other scopes we need if we are logged in.
if(Auth::check()) {
$extraScopes = EsiScope::where([
'character_id' => auth()->user()->getId(),
])->get(['scope'])->toArray();
array_push($scopes, $extraScopes);
}
return $social->driver('eveonline')
->scopes([])
->scopes($scopes)
->redirect();
//return Socialite::driver('eveonline')->redirect();
}
/**