Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
42 | protected function googleAuth(string $accessToken): ?Authenticatable |
||
43 | { |
||
44 | $client = new \Google_Client(['client_id' => config('auth.google_oauth_client_id')]); |
||
45 | $payload = $client->verifyIdToken($accessToken); |
||
46 | if ($payload) { |
||
47 | $userName = $payload['email']; |
||
48 | if ($this->tenantManager->loadTenantByUsername($userName)) { |
||
49 | return User::where('email', $userName)->first(); |
||
50 | } |
||
51 | } |
||
52 | |||
53 | return null; |
||
54 | } |
||
56 |