Commit 40286137 authored by Nelso Jost's avatar Nelso Jost

FIX: better user hash approach

parent c64a09ff
......@@ -110,4 +110,4 @@ class UserDataForm(Form):
def __init__(self):
super().__init__()
self.user_hash.data = current_user.password_hash
self.user_hash.data = current_user.user_hash
......@@ -42,6 +42,10 @@ class User(UserMixin, db.Model, DBUtils):
def verify_password(self, password):
return check_password_hash(self.password_hash, password)
@property
def user_hash(self):
return generate_password_hash(self.password_hash + self.username)
def generate_confirmation_token(self, expiration=3600):
s = Serializer(current_app.config['SECRET_KEY'], expiration)
return s.dumps({'confirm': self.id})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment