diff --git a/auth_jwt/models/auth_jwt_validator.py b/auth_jwt/models/auth_jwt_validator.py index 5d841888be..41451abee2 100644 --- a/auth_jwt/models/auth_jwt_validator.py +++ b/auth_jwt/models/auth_jwt_validator.py @@ -114,7 +114,7 @@ def _decode(self, token): header = jwt.get_unverified_header(token) except Exception as e: _logger.info("Invalid token: %s", e) - raise UnauthorizedInvalidToken() + raise UnauthorizedInvalidToken() from e key = self._get_key(header.get("kid")) algorithm = self.public_key_algorithm try: @@ -133,7 +133,7 @@ def _decode(self, token): ) except Exception as e: _logger.info("Invalid token: %s", e) - raise UnauthorizedInvalidToken() + raise UnauthorizedInvalidToken() from e return payload def _get_uid(self, payload): @@ -194,8 +194,8 @@ def _unregister_auth_method(self): try: delattr(IrHttp.__class__, f"_auth_method_jwt_{rec.name}") delattr(IrHttp.__class__, f"_auth_method_public_or_jwt_{rec.name}") - except AttributeError: - pass + except AttributeError as e: + _logger.info("AttributeError: %s", e) @api.model_create_multi def create(self, vals): diff --git a/auth_jwt/views/auth_jwt_validator_views.xml b/auth_jwt/views/auth_jwt_validator_views.xml index 11c9c42e75..90df5557f3 100644 --- a/auth_jwt/views/auth_jwt_validator_views.xml +++ b/auth_jwt/views/auth_jwt_validator_views.xml @@ -1,4 +1,5 @@ + auth.jwt.validator.form