| xqd
@@ -1,22 +1,22 @@
|
|
|
<?php
|
|
|
|
|
|
-namespace App\libs\google;
|
|
|
+namespace App\libs\google\Gateways;
|
|
|
|
|
|
use Google\Client;
|
|
|
use Illuminate\Support\Facades\Config;
|
|
|
|
|
|
class GoogleOauth
|
|
|
{
|
|
|
- private static $config;
|
|
|
- private static $client;
|
|
|
+ private $config;
|
|
|
+ private $client;
|
|
|
public function __construct()
|
|
|
{
|
|
|
- self::$config = Config::get('swdz.goodle');
|
|
|
- self::$client = new Client([
|
|
|
- 'client_id' => self::$config['client_id'],
|
|
|
- 'client_secret' => self::$config['client_secret'],
|
|
|
- 'redirect_uri' => self::$config['redirect_uri'],
|
|
|
- 'scopes' => self::$config['scopes']
|
|
|
+ $this->config = Config::get('swdz.goodle');
|
|
|
+ $this->client = new Client([
|
|
|
+ 'client_id' => $this->config['client_id'],
|
|
|
+ 'client_secret' => $this->config['client_secret'],
|
|
|
+ 'redirect_uri' => $this->config['redirect_uri'],
|
|
|
+ 'scopes' => $this->config['scopes']
|
|
|
]);
|
|
|
}
|
|
|
|
| xqd
@@ -27,10 +27,9 @@ class GoogleOauth
|
|
|
* @throws \Psr\Container\ContainerExceptionInterface
|
|
|
* @throws \Psr\Container\NotFoundExceptionInterface
|
|
|
*/
|
|
|
- public static function appAuth(){
|
|
|
+ public function appAuth(){
|
|
|
$code = request()->get('code', null);
|
|
|
- var_dump($code);
|
|
|
- return self::$client->verifyIdToken($code);
|
|
|
+ return $this->client->verifyIdToken($code);
|
|
|
}
|
|
|
|
|
|
/**
|