Raise an error only if required is True and token is not present
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user