| 1 | <?php |
||
| 7 | class Blacklist |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var \Tymon\JWTAuth\Providers\Storage\StorageInterface |
||
| 11 | */ |
||
| 12 | protected $storage; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param \Tymon\JWTAuth\Providers\Storage\StorageInterface $storage |
||
| 16 | */ |
||
| 17 | 15 | public function __construct(StorageInterface $storage) |
|
| 21 | |||
| 22 | /** |
||
| 23 | * Add the token (jti claim) to the blacklist |
||
| 24 | * |
||
| 25 | * @param \Tymon\JWTAuth\Payload $payload |
||
| 26 | * @return boolean |
||
| 27 | */ |
||
| 28 | 6 | public function add(Payload $payload) |
|
| 45 | |||
| 46 | /** |
||
| 47 | * Determine whether the token has been blacklisted |
||
| 48 | * |
||
| 49 | * @param \Tymon\JWTAuth\Payload $payload |
||
| 50 | * @return boolean |
||
| 51 | */ |
||
| 52 | 3 | public function has(Payload $payload) |
|
| 56 | |||
| 57 | /** |
||
| 58 | * Remove the token (jti claim) from the blacklist |
||
| 59 | * |
||
| 60 | * @param \Tymon\JWTAuth\Payload $payload |
||
| 61 | * @return boolean |
||
| 62 | */ |
||
| 63 | 3 | public function remove(Payload $payload) |
|
| 67 | |||
| 68 | /** |
||
| 69 | * Remove all tokens from the blacklist |
||
| 70 | * |
||
| 71 | * @return boolean |
||
| 72 | */ |
||
| 73 | 3 | public function clear() |
|
| 79 | } |
||
| 80 |