Ejemplo n.º 1
0
 /**
  * Decode JWT token.
  *
  * @param string $token JWT token to decode.
  *
  * @return object|null The JWT's payload as a PHP object, null on failure.
  */
 protected function _decode($token)
 {
     try {
         $payload = JWT::decode($token, Security::salt(), $this->_config['allowedAlgs']);
         return $payload;
     } catch (Exception $e) {
         if (Configure::read('debug')) {
             throw $e;
         }
         $this->_error = $e;
     }
 }