You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The LogoutView is returning a 500 error when handling blacklisted, invalid, or expired tokens. The issue arises because the exception handling block compares error messages as plain text without using gettext, which leads to a failure in non-english rest_framework_simplejwt.tokens.RefreshToken response.
if 'Token is blacklisted' in error.args or 'Token is invalid or expired' in error.args:
response.data = {'detail': _(error.args[0])}
response.status_code = status.HTTP_401_UNAUTHORIZED
else:
response.data = {'detail': _('An error has occurred.')}
response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
The text was updated successfully, but these errors were encountered:
The LogoutView is returning a 500 error when handling blacklisted, invalid, or expired tokens. The issue arises because the exception handling block compares error messages as plain text without using gettext, which leads to a failure in non-english rest_framework_simplejwt.tokens.RefreshToken response.
The text was updated successfully, but these errors were encountered: