1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00
invoiceninja/app/Ninja/OAuth/Providers/Google.php

23 lines
471 B
PHP
Raw Normal View History

<?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)
2017-08-08 04:55:50 +02:00
{
return $payload['sub']; // user ID
2017-08-08 04:55:50 +02:00
}
}