From 39dd86d6fbc7d8d9866170651d1dc639aaa3d913 Mon Sep 17 00:00:00 2001 From: Gautham Pai Date: Tue, 24 Jul 2018 17:40:15 +0530 Subject: [PATCH] Raise an error only if required is True and token is not present --- gluon/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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