Use encryption module from utils

Now that the encryption module has been moved from this app to utils, we
can remove it from here (along with its tests) and import it from utils
instead. This also renames the `encryption.py` file to `hashing.py`,
since it no longer contains the encryption class.
This commit is contained in:
Katie Smith
2020-01-23 17:36:32 +00:00
parent 1703ae6031
commit 64c2061baa
6 changed files with 13 additions and 47 deletions

10
app/hashing.py Normal file
View File

@@ -0,0 +1,10 @@
from flask_bcrypt import generate_password_hash, check_password_hash
def hashpw(password):
return generate_password_hash(password.encode('UTF-8'), 10).decode('utf-8')
def check_hash(password, hashed_password):
# If salt is invalid throws a 500 should add try/catch here
return check_password_hash(hashed_password, password)