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

@@ -1,5 +1,7 @@
from datetime import datetime
from sqlalchemy.orm import load_only
from app import db, login_manager
from app.models import User
from app.main.encryption import hashpw
@@ -63,3 +65,7 @@ def update_password(id, password):
user.password_changed_at = datetime.now()
db.session.add(user)
db.session.commit()
def find_all_email_address():
return [x.email_address for x in User.query.options(load_only("email_address")).all()]