log original error when token decoding fails w/ burnettk
This commit is contained in:
parent
40af8809a1
commit
c6f0dd65e5
|
@ -420,17 +420,18 @@ def _get_decoded_token(token: str) -> dict:
|
|||
try:
|
||||
decoded_token: dict = AuthenticationService.parse_jwt_token(_get_authentication_identifier_from_request(), token)
|
||||
except Exception as e:
|
||||
current_app.logger.warning(f"Received exception when attempting to decode token: {e.__class__.__name__}: {str(e)}")
|
||||
AuthenticationService.set_user_has_logged_out()
|
||||
raise ApiError(error_code="invalid_token", message="Cannot decode token.", status_code=401) from e
|
||||
|
||||
if "iss" in decoded_token:
|
||||
return decoded_token
|
||||
else:
|
||||
if "iss" in decoded_token:
|
||||
return decoded_token
|
||||
else:
|
||||
current_app.logger.error(f"Unknown token type in get_decoded_token: token: {token}")
|
||||
raise ApiError(
|
||||
error_code="unknown_token",
|
||||
message="Unknown token type in get_decoded_token",
|
||||
)
|
||||
current_app.logger.error(f"Unknown token type in get_decoded_token: token: {token}")
|
||||
raise ApiError(
|
||||
error_code="unknown_token",
|
||||
message="Unknown token type in get_decoded_token",
|
||||
)
|
||||
|
||||
|
||||
def _get_authentication_identifier_from_request() -> str:
|
||||
|
|
Loading…
Reference in New Issue