decodeToken() public method

Decode the provided token into an array
public decodeToken ( string $token, string $secret, string $algorithm = 'HS256' ) : array
$token string
$secret string
$algorithm string
return array
 public function it_decodes_tokens()
 {
     $token = JWT::encode($payload = ['exp' => time() + 30, 'iat' => time(), 'nbf' => time(), 'context' => ['foo' => 'bar']], $secret = 'secret_123');
     $driver = new FirebaseDriver();
     $result = $driver->decodeToken($token, $secret);
     if ($result['exp'] !== $payload['exp'] || $result['iat'] !== $payload['iat'] || $result['nbf'] !== $payload['nbf'] || $result['context']['foo'] !== $payload['context']['foo']) {
         throw new \Exception('Decoded payload did not match the encoded tokens payload. ' . $token);
     }
 }