diff --git a/data/users.py b/data/users.py index e5ceedb..9909c93 100644 --- a/data/users.py +++ b/data/users.py @@ -29,5 +29,8 @@ class User(SqlAlchemyBase, UserMixin): def check_password(self, password): return check_password_hash(self.password, password) + def check_hash_password(self, hash_password): + return True if self.password == hash_password else False + def set_password(self, password): self.password = generate_password_hash(password) diff --git a/main.py b/main.py index ba190e9..59f21f5 100644 --- a/main.py +++ b/main.py @@ -742,7 +742,7 @@ def check_auth(): session = db_session.create_session() user = session.query(User).filter(User.email == email).first() if user: - if user.check_password(password): + if user.check_password(password) or user.check_hash_password(password): return make_response(jsonify({ 'key': '', 'name': user.name,