diff --git a/auth_jwt/application.py b/auth_jwt/application.py index d881256..bdde0b7 100644 --- a/auth_jwt/application.py +++ b/auth_jwt/application.py @@ -1,5 +1,4 @@ import jwt -import logging import os import json from datetime import datetime, timedelta @@ -23,7 +22,6 @@ def verify_client(self, client): if 'client_id' in client_info: client_id = client_info['client_id'] obj_client = client.query(client.client_id == client_id).get() - logging.warning("Client: %s" % obj_client) if obj_client: decoded_token = verify_jwt_flask(inbound_app_id, obj_client.client_secret) @@ -62,7 +60,7 @@ def verify_client(self, client): def verify_user(self, user): if self: if issubclass(self.__class__, Resource): - logging.warning('verifying user requests') + if 'Authorization' in request.headers: authorization_header = request.headers.get('Authorization') inbound_app_id = authorization_header.split(' ')[1] @@ -98,11 +96,9 @@ def verify_jwt_flask(token, secret): return decoded_token except jwt.exceptions.ExpiredSignatureError, e: msg = "Error: %s - %s" % (e.__class__, e.message) - logging.warning(msg) abort(403, message=e.message) except jwt.InvalidTokenError, e: - logging.warning("Error in JWT token: %s" % e) return False @@ -208,4 +204,4 @@ def inner(self, *args, **kwargs): abort(401, message="Unauthorized: Please set ALLOWED_HOSTS environment variable") else: abort(401, message="Unauthorized no origin") - return inner \ No newline at end of file + return inner