From 1cf77ae57101fdf3855346bacf362c74cac95f4c Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 9 Feb 2018 12:44:54 +0100 Subject: [PATCH 1/2] Remove password hashing for each token login --- flask_security/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flask_security/core.py b/flask_security/core.py index bae5e0b8..ec9be195 100644 --- a/flask_security/core.py +++ b/flask_security/core.py @@ -30,7 +30,7 @@ ResetPasswordForm, SendConfirmationForm from .utils import config_value as cv from .utils import _, get_config, hash_data, localize_callback, string_types, \ - url_for_security, verify_hash, send_mail + url_for_security, send_mail from .views import create_blueprint # Convenient references @@ -247,9 +247,9 @@ def _request_loader(request): data = _security.remember_token_serializer.loads( token, max_age=_security.token_max_age) user = _security.datastore.find_user(id=data[0]) - if user and verify_hash(data[1], user.password): + if user: return user - except: + except Exception as e: pass return _security.login_manager.anonymous_user() From d438b5a649490b090e9efb9ced161772df94a0c4 Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 9 Feb 2018 12:52:21 +0100 Subject: [PATCH 2/2] Remove pyflakes warning --- flask_security/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_security/core.py b/flask_security/core.py index ec9be195..3b51fb5f 100644 --- a/flask_security/core.py +++ b/flask_security/core.py @@ -249,7 +249,7 @@ def _request_loader(request): user = _security.datastore.find_user(id=data[0]) if user: return user - except Exception as e: + except: pass return _security.login_manager.anonymous_user()