mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 14:37:33 -04:00 
			
		
		
		
	Merge branch 'develop' of github.com:invoiceninja/invoiceninja into develop
This commit is contained in:
		
						commit
						07296fae9b
					
				| @ -30,7 +30,7 @@ class OAuth { | ||||
|         $user = null; | ||||
| 
 | ||||
|         if($this->providerInstance) | ||||
|             $user = User::where('email', $this->providerInstance->getTokenResponse($token))->first(); | ||||
|             $user = User::where('oauth_user_id', $this->providerInstance->getTokenResponse($token))->first(); | ||||
| 
 | ||||
|         if ($user) | ||||
|             return $user; | ||||
|  | ||||
| @ -9,7 +9,7 @@ class Google implements ProviderInterface | ||||
|         $client = new \Google_Client(['client_id' => env('GOOGLE_CLIENT_ID','')]); | ||||
|         $payload = $client->verifyIdToken($token); | ||||
|         if ($payload) | ||||
|             return $this->harvestEmail($payload); | ||||
|             return $this->harvestSubField($payload); | ||||
|         else | ||||
|             return null; | ||||
|     } | ||||
| @ -19,5 +19,9 @@ class Google implements ProviderInterface | ||||
|         return $payload['email']; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     private function harvestSubField($payload) | ||||
|     { | ||||
|         $data = $payload->getAttributes(); | ||||
|         return $data['payload']['sub']; // user ID
 | ||||
|     } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user