INNER CODE UNIT · Python

_verify_jwt_optional_in_request

IndominusByte/fastapi-jwt-auth · fastapi_jwt_auth/auth_jwt.py:576

    def _verify_jwt_optional_in_request(self,token: str) -> None:
        """
        Optionally check if this request has a valid access token

        :param token: The encoded JWT
        """
        if token: self._verifying_token(token)

        if token and self.get_raw_jwt(token)['type'] != 'access':
            raise AccessTokenRequired(status_code=422,message="Only access tokens are allowed")

    def _verify_jwt_in_request(
        self,
        token: str,
        type_token: str,
        token_from: str,
        fresh: Optional[bool] = False
    ) -> None:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…