Fixing a bug - the allows_jwt method does NOT throw any error if a token is not found at all.
This could cause potential security issues as developers decorate their methods with @allows_jwt and then not pass a token and the method allows the call. Signed-off-by: Gautham <buzypi@gmail.com>
This commit is contained in:
@@ -1335,6 +1335,8 @@ class AuthJWT(object):
|
|||||||
if required:
|
if required:
|
||||||
raise e
|
raise e
|
||||||
token = None
|
token = None
|
||||||
|
if not token:
|
||||||
|
raise HTTP(400, 'Invalid token')
|
||||||
if token and len(token) < self.max_header_length:
|
if token and len(token) < self.max_header_length:
|
||||||
old_verify_expiration = self.verify_expiration
|
old_verify_expiration = self.verify_expiration
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user