diff --git a/gluon/tools.py b/gluon/tools.py index 1078f9eb..26814b1b 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -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