get() public method

Returns the Sentinel session value.
public get ( ) : mixed
return mixed
 /**
  * {@inheritDoc}
  */
 public function check()
 {
     if ($code = $this->session->get()) {
         return $code;
     }
     if ($code = $this->cookie->get()) {
         return $code;
     }
 }
示例#2
0
 /**
  * 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\Sentinel\Addons\Social\AccessMissingException
  */
 protected function retrieveToken($provider)
 {
     if ($this->oauthVersion($provider) == 1) {
         $temporaryIdentifier = $this->request->getOAuth1TemporaryCredentialsIdentifier();
         if (!$temporaryIdentifier) {
             throw new AccessMissingException('Missing [oauth_token] parameter (used for OAuth1 temporary credentials identifier).');
         }
         $verifier = $this->request->getOAuth1Verifier();
         if (!$verifier) {
             throw new AccessMissingException('Missing [verifier] parameter.');
         }
         $temporaryCredentials = $this->session->get();
         $tokenCredentials = $provider->getTokenCredentials($temporaryCredentials, $temporaryIdentifier, $verifier);
         return $tokenCredentials;
     }
     $code = $this->request->getOAuth2Code();
     if (!$code) {
         throw new AccessMissingException("Missing [code] parameter.");
     }
     $accessToken = $provider->getAccessToken('authorization_code', compact('code'));
     return $accessToken;
 }