GenTux\Jwt\JwtToken::validateOrFail PHP Method

validateOrFail() public method

Validate the token or throw an exception
public validateOrFail ( string | null $secret = null, string | null $algo = null ) : boolean
$secret string | null
$algo string | null
return boolean
    public function validateOrFail($secret = null, $algo = null)
    {
        if (!$this->validate($secret, $algo)) {
            throw new InvalidTokenException('Token is not valid.');
        }
        return true;
    }