Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit deea4ad

Browse files
committed
Catch InvalidTokenError and raise exception #100
1 parent 97254ba commit deea4ad

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rest_framework_jwt/authentication.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def authenticate(self, request):
3535
except jwt.DecodeError:
3636
msg = _('Error decoding signature.')
3737
raise exceptions.AuthenticationFailed(msg)
38+
except jwt.InvalidTokenError:
39+
raise exceptions.AuthenticationFailed()
3840

3941
user = self.authenticate_credentials(payload)
4042

0 commit comments

Comments
 (0)