GenTux\Jwt\Exceptions\JwtExceptionHandler::handleJwtException PHP Method

handleJwtException() public method

Render JWT exception
public handleJwtException ( JwtException $e ) : Illuminate\Http\Response
$e JwtException
return Illuminate\Http\Response
    public function handleJwtException(JwtException $e)
    {
        if ($e instanceof InvalidTokenException) {
            return $this->handleJwtInvalidToken($e);
        } elseif ($e instanceof NoTokenException) {
            return $this->handleJwtNoToken($e);
        } elseif ($e instanceof NoSecretException) {
            return $this->handleJwtNoSecret($e);
        } else {
            $message = getenv('JWT_MESSAGE_ERROR') ?: 'There was an error while validating the authorization token.';
            return response()->json(['error' => $message], 500);
        }
    }