1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00
invoiceninja/app/Ninja/OAuth/Providers/Google.php
David Bomba 4bccf5f307 Bug fix for Google Provider (#1607)
* bug fix for Google provider
2017-08-08 20:36:28 +10:00

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
}
}