Skip to content

Commit e89e0a7

Browse files
committed
Fix a bug
1 parent 4940ed6 commit e89e0a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

django_jwt/decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ def wrapper(request, *args, **kwargs):
5555
try:
5656
jwt_data = _decode_jwt_from_request(request)
5757
except (NoAuthorizationError, InvalidHeaderError) as e:
58-
return JsonResponse({settings.ERROR_MESSAGE_KEY: str(e)}, status=401)
58+
return JsonResponse({settings.JWT['ERROR_MESSAGE_KEY']: str(e)}, status=401)
5959
identity_field = settings.JWT['IDENTITY_FIELD']
6060
identity = jwt_data[identity_field]
6161
user = _load_user({identity_field: identity})
6262
if not user:
63-
return JsonResponse({settings.ERROR_MESSAGE_KEY: 'Invalid JWT'}, status=401)
63+
return JsonResponse({settings.JWT['ERROR_MESSAGE_KEY']: 'Invalid JWT'}, status=401)
6464
request.user = user
6565
return view_func(request, *args, **kwargs)
6666

0 commit comments

Comments
 (0)