mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 22:22:32 +01:00
4bccf5f307
* bug fix for Google provider
23 lines
471 B
PHP
23 lines
471 B
PHP
<?php namespace App\Ninja\OAuth\Providers;
|
|
|
|
class Google implements ProviderInterface
|
|
{
|
|
|
|
public function getTokenResponse($token)
|
|
{
|
|
|
|
$client = new \Google_Client(['client_id' => env('GOOGLE_CLIENT_ID','')]);
|
|
return $client->verifyIdToken($token);
|
|
}
|
|
|
|
public function harvestEmail($payload)
|
|
{
|
|
return $payload['email'];
|
|
}
|
|
|
|
public function harvestSubField($payload)
|
|
{
|
|
return $payload['sub']; // user ID
|
|
}
|
|
}
|