| Conditions | 2 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function verifyJwt($jwt) |
||
| 28 | { |
||
| 29 | include_once PROJECT_ROOT_PATH . '/../includes/libraries/Firebase/JWT/JWT.php'; |
||
| 30 | $JWT = new Firebase\JWT\JWT(); |
||
| 31 | |||
| 32 | try { |
||
| 33 | $decoded = $JWT->decode($jwt, DB_PASSWD, array('HS256')); |
||
| 34 | |||
| 35 | // Access is granted. |
||
| 36 | return array( |
||
| 37 | "message" => "Access granted:", |
||
| 38 | "error" => $e->getMessage() |
||
| 39 | ); |
||
| 40 | |||
| 41 | }catch (Exception $e) { |
||
| 42 | return false; |
||
| 43 | } |
||
| 45 | } |