mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Working on OAuth (#3693)
This commit is contained in:
parent
350b61dc3f
commit
fb5a923639
@ -481,10 +481,14 @@ class LoginController extends BaseController
|
||||
|
||||
//server_auth_code
|
||||
$client = new \Google_Client();
|
||||
//$accessToken = $client->fetchAccessTokenWithAuthCode(request()->input('server_auth_code'));
|
||||
//$client->setAccessToken($accessToken);
|
||||
$client->setClientId(config('ninja.auth.google.client_id'));
|
||||
$client->setClientSecret(config('ninja.auth.google.client_secret'));
|
||||
|
||||
$accessToken = $client->fetchAccessTokenWithAuthCode(request()->input('server_auth_code'));
|
||||
info($accessToken);
|
||||
|
||||
$client->setAccessToken(request()->input('access_token'));
|
||||
$client->setAccessToken($accessToken);
|
||||
//$client->setAccessToken(request()->input('access_token'));
|
||||
$refresh_token = $client->getRefreshToken();
|
||||
|
||||
$name = OAuth::splitName($google->harvestName($user));
|
||||
|
@ -147,5 +147,11 @@ return [
|
||||
'enterprise' => [
|
||||
'daily_emails' => 200,
|
||||
]
|
||||
],
|
||||
'auth' => [
|
||||
'google' => [
|
||||
'client_id' => env('GOOGLE_CLIENT_ID', ''),
|
||||
'client_secret' => env('GOOGLE_CLIENT_SECRET','')
|
||||
]
|
||||
]
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user