text: from fastapi import Request, HTTPException
  from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
  
  from src.core.auth.token import decode_jwt
  
  
  class JWTBearer(HTTPBearer):
      def __init__(self, auto_error: bool = True):
          super(JWTBearer, self).__init__(auto_error=auto_error)
  
      async def __call__(self, request: Request):
          credentials: HTTPAuthorizationCredentials = await super(JWTBearer, self).__call__(request)
          if credentials:
              if not credentials.scheme == "Bearer":
                  raise HTTPException(status_code=403, detail="Invalid authentication scheme.")
              if not self.verify_jwt(credentials.credentials):
                  raise HTTPException(status_code=403, detail="Invalid token or expired token.")
              return credentials.credentials
          else:
              raise HTTPException(status_code=403, detail="Invalid authorization code.")
  
      @staticmethod
      def verify_jwt(jwt_token: str) -> bool:
          try:
              payload = decode_jwt(jwt_token)
          except:
              return False
  
          if payload:
              return True
          return False
  