Raise an error only if required is True and token is not present

This commit is contained in:
Gautham Pai
2018-07-24 17:40:15 +05:30
committed by GitHub
parent bc59d58a3e
commit 39dd86d6fb
+1 -1
View File
@@ -1335,7 +1335,7 @@ class AuthJWT(object):
if required:
raise e
token = None
if not token:
if not token and required:
raise HTTP(400, 'Invalid token')
if token and len(token) < self.max_header_length:
old_verify_expiration = self.verify_expiration