Development
This commit is contained in:
parent
8a8e947fcf
commit
450c0081f7
9 changed files with 59 additions and 28 deletions
|
|
@ -1,6 +1,5 @@
|
|||
from pathlib import Path
|
||||
from flask import Blueprint, request, session, redirect, flash
|
||||
import bcrypt
|
||||
import auth
|
||||
import config_utils
|
||||
import sanitize
|
||||
|
|
@ -29,7 +28,7 @@ def form_login():
|
|||
if email != settings.get_initial_manager_email() or not stored_hash:
|
||||
flash('Invalid email address or password.', 'error')
|
||||
return redirect(f'/{_PAGE}')
|
||||
if not bcrypt.checkpw(password.encode('utf-8'), stored_hash.encode('utf-8')):
|
||||
if not settings.verify_password(password, stored_hash):
|
||||
flash('Invalid email address or password.', 'error')
|
||||
return redirect(f'/{_PAGE}')
|
||||
session.clear()
|
||||
|
|
@ -76,7 +75,7 @@ def form_login():
|
|||
flash('Account setup is not complete. Please use Create Account to set your password first.', 'error')
|
||||
return redirect(f'/{_PAGE}')
|
||||
|
||||
if not bcrypt.checkpw(password.encode('utf-8'), account['hashed_password'].encode('utf-8')):
|
||||
if not settings.verify_password(password, account['hashed_password']):
|
||||
flash('Invalid email address or password.', 'error')
|
||||
return redirect(f'/{_PAGE}')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue