mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 03:13:42 -05:00
Includes validation for gov.uk email address, mobile number with +44, password at least 10 char. Form validation errors will be added to template in a later story. User is created when form validates.
11 lines
325 B
Python
11 lines
325 B
Python
from flask.ext.bcrypt import generate_password_hash, check_password_hash
|
|
|
|
|
|
def hashpw(password):
|
|
return generate_password_hash(password.encode('UTF-8'), 10)
|
|
|
|
|
|
def checkpw(password, hashed_password):
|
|
# If salt is invalid throws a 500 should add try/catch here
|
|
return check_password_hash(hashed_password, password)
|