1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/app/Libraries/OAuth/Providers/Google.php
2020-05-13 16:20:05 +10:00

29 lines
520 B
PHP

<?php
namespace App\Libraries\OAuth\Providers;
class Google implements ProviderInterface
{
public function getTokenResponse($token)
{
$client = new \Google_Client();
return $client->verifyIdToken($token);
}
public function harvestEmail($payload)
{
return $payload['email'];
}
public function harvestSubField($payload)
{
return $payload['sub']; // user ID
}
public function harvestName($payload)
{
return $payload['name'];
}
}