Ver código fonte

[ADD] tasks execution

Gogs 7 anos atrás
pai
commit
71668035af
2 arquivos alterados com 5 adições e 1 exclusões
  1. 2 1
      api/utils/jwt_authentication.py
  2. 3 0
      api/utils/jwt_token.py

+ 2 - 1
api/utils/jwt_authentication.py

@@ -26,8 +26,9 @@ class JWTAuthentication(Authentication):
             return False
 
         prefix_length = len(settings.JWT_PREFIX_HEADER)
+        (_, ok) = check_token(authorization_header[prefix_length + 1:])
 
-        return check_token(authorization_header[prefix_length + 1:])
+        return ok
     '''
     '''
     def get_identifier(self, request):

+ 3 - 0
api/utils/jwt_token.py

@@ -31,6 +31,9 @@ def create_token(username, password):
 '''
 '''
 def explode_token(token):
+    if not token:
+        return False
+
     # Normalize token
     if token.startswith(settings.JWT_PREFIX_HEADER):
         prefix_length = len(settings.JWT_PREFIX_HEADER)