providerInstance = new Providers\Google(); $this->providerId = self::SOCIAL_GOOGLE; return $this; default: return null; break; } } public function getTokenResponse($token) { $user = null; $payload = $this->providerInstance->getTokenResponse($token); $oauthUserId = $this->providerInstance->harvestSubField($payload); LookupUser::setServerByField('oauth_user_key', $this->providerId . '-' . $oauthUserId); if($this->providerInstance) $user = User::where('oauth_user_id', $oauthUserId)->where('oauth_provider_id', $this->providerId)->first(); if ($user) return $user; else return false; } } ?>