mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 11:28:25 -04:00
New-password endpoints are implemented.
There should be a better way to validate the token.
This commit is contained in:
@@ -3,9 +3,15 @@ from app import db
|
||||
from app.models import PasswordResetToken
|
||||
|
||||
|
||||
def insert(token):
|
||||
token.expiry_date = datetime.now() + timedelta(hours=1)
|
||||
db.session.add(token)
|
||||
def insert(token, user_id):
|
||||
password_reset_token = PasswordResetToken(token=token,
|
||||
user_id=user_id,
|
||||
expiry_date=datetime.now() + timedelta(hours=1))
|
||||
insert_token(password_reset_token)
|
||||
|
||||
|
||||
def insert_token(password_reset_token):
|
||||
db.session.add(password_reset_token)
|
||||
db.session.commit()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user