mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-11-01 00:37:33 -04:00
24 lines
485 B
PHP
24 lines
485 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','')]);
|
|
$payload = $client->verifyIdToken($token);
|
|
if ($payload)
|
|
return $this->harvestEmail($payload);
|
|
else
|
|
return null;
|
|
}
|
|
|
|
public function harvestEmail($payload)
|
|
{
|
|
return $payload['email'];
|
|
}
|
|
|
|
|
|
}
|