Completion of forgot-password endpoints.

Start implementation for new-password endpoints.
Created PasswordResetToken model
ToDo: create and save token, send valid url to user,
check validity of token, update user's password, redirect to /two-factor.
This commit is contained in:
Rebecca Law
2016-01-05 17:52:09 +00:00
parent 6696426dbc
commit 2cb896fa81
15 changed files with 187 additions and 33 deletions

View File

@@ -111,6 +111,13 @@ class Service(db.Model):
return filter_null_value_fields(serialized)
class PasswordResetToken(db.Model):
id = db.Column(db.Integer, primary_key=True)
token = db.Column(db.String, unique=True, index=True, nullable=False)
user_id = db.Column(db.Integer, db.ForeignKey('users.id'), unique=False, nullable=False)
expiry_date = db.Column(db.DateTime, nullable=False)
def filter_null_value_fields(obj):
return dict(
filter(lambda x: x[1] is not None, obj.items())