Files
notifications-admin/app/main/encryption.py
Rebecca Law 64d2cbb927 108536366: Implement register flow
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.
2015-12-01 16:41:49 +00:00

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)