Last active
September 2, 2016 21:22
-
-
Save Spomky/cfe8d510548e16fe3f9bf3c6b0b372ff to your computer and use it in GitHub Desktop.
Proposition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Lexik\Bundle\JWTAuthenticationBundle\Exception; | |
/** | |
* Base class for exceptions thrown during JWTEncoderInterface::encode(). | |
* | |
* @author Robin Chalas <[email protected]> | |
*/ | |
class JWTEncodeFailureException extends JWTFailureException | |
{ | |
const INVALID_KEY = 'invalid_key'; | |
const UNSIGNED_JWS = 'unsigned_jws'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Lexik\Bundle\JWTAuthenticationBundle\Exception; | |
/** | |
* Base class for exceptions thrown during JWTEncoderInterface::decode(). | |
* | |
* @author Robin Chalas <[email protected]> | |
*/ | |
class JWTDecodeFailureException extends JWTFailureException | |
{ | |
const INVALID_JWT = 'invalid_jwt'; | |
const UNVERIFIED_JWS = 'unverified_jws'; | |
const EXPIRED_JWT = 'expired_jwt'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Lexik\Bundle\JWTAuthenticationBundle\Exception; | |
/** | |
* Base class for exceptions thrown during JWT creation/loading. | |
* | |
* @author Robin Chalas <[email protected]> | |
*/ | |
class JWTFailureException extends \Exception | |
{ | |
/** | |
* @var string | |
*/ | |
private $reason; | |
/** | |
* @param string $message | |
* @param string $reason | |
* @param \Exception|null $previous | |
*/ | |
public function __construct($message, $reason, \Exception $previous = null) | |
{ | |
parent::__construct($message, 0, $previous); | |
} | |
/** | |
* @return string | |
*/ | |
public function getReason() | |
{ | |
return $this->reason; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment