protected function oauthComplete() { // Login succesful $response = $this->client->get_user_data(); //make sure the response is valid by checking id if (isset($response['id'])) { // Check whether that id exists in our identities table (provider_id field) $user = User::check_identity($response['id'], $this->provider); if (isset($response['email'])) { // @see Controller_Provider::sso_signup $this->sso_signup($response, $user); } } return $response; }