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);
}
}