/** * Logs the current user out. * * @return void */ public function logout() { $this->user = null; setcookie('synergixe_sso', serialize($this->session->get()), time() - 24 * 3600, "/", ".synergixe.ng", FALSE, TRUE); $this->session->forget(); $this->cookie->forget(); }
/** * Logs the current user out. * * @return void */ public function logout() { $this->user = null; $this->session->forget(); $this->cookie->forget(); }
/** * Retrieves a token (OAuth1 token credentials or OAuth2 access * token) for the given provider, abstracting away the * differences from the user. * * @param mixed $provider * @return mixed * @throws \Cartalyst\SentrySocial\AccessMissingException */ protected function retrieveToken($provider) { if ($this->oauthVersion($provider) == 1) { $temporaryIdentifier = $this->requestProvider->getOAuth1TemporaryCredentialsIdentifier(); if (!$temporaryIdentifier) { throw new AccessMissingException('Missing [oauth_token] parameter (used for OAuth1 temporary credentials identifier).'); } $verifier = $this->requestProvider->getOAuth1Verifier(); if (!$verifier) { throw new AccessMissingException('Missing [verifier] parameter.'); } $temporaryCredentials = $this->session->get(); $tokenCredentials = $provider->getTokenCredentials($temporaryCredentials, $temporaryIdentifier, $verifier); return $tokenCredentials; } $code = $this->requestProvider->getOAuth2Code(); if (!$code) { throw new AccessMissingException("Missing [code] parameter."); } $accessToken = $provider->getAccessToken('authorization_code', compact('code')); return $accessToken; }