| Total Complexity | 4 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Middleware |
||
| 6 | { |
||
| 7 | protected string $key; |
||
| 8 | protected string $header; |
||
| 9 | |||
| 10 | public function __construct() |
||
| 11 | { |
||
| 12 | $this->key = KEY_JWT; |
||
| 13 | $this->header = base64_encode(json_encode([ |
||
| 14 | 'typ' => 'JWT', |
||
| 15 | 'alg' => 'HS256' |
||
| 16 | ])); |
||
| 17 | } |
||
| 18 | |||
| 19 | public function create(string $email): string |
||
| 30 | } |
||
| 31 | |||
| 32 | public function validate(): bool |
||
| 44 | } |
||
| 45 | } |