From 1f19c9cd0d2df6271c93ae296652daa11153e49e Mon Sep 17 00:00:00 2001 From: azivner Date: Sat, 9 Sep 2017 14:25:35 -0400 Subject: [PATCH] password is loaded on the fly so it's not necessary to restart app for the changes to take place (if no re-encryption is done) --- src/app.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/app.py b/src/app.py index 8ff1729c1..c7ac71a99 100644 --- a/src/app.py +++ b/src/app.py @@ -54,11 +54,8 @@ documentPath = config['Document']['documentPath'] connect(documentPath) -hashedPassword = password_provider.getPasswordHash() - - -def verify_password(hex_hashed_password, guessed_password): - hashed_password = binascii.unhexlify(hex_hashed_password) +def verify_password(guessed_password): + hashed_password = binascii.unhexlify(password_provider.getPasswordHash()) guess_hashed = my_scrypt.getVerificationHash(guessed_password) @@ -68,7 +65,7 @@ def verify_password(hex_hashed_password, guessed_password): def login_post(): guessedPassword = request.form['password'].encode('utf-8') - if request.form['username'] == user.id and verify_password(hashedPassword, guessedPassword): + if request.form['username'] == user.id and verify_password(guessedPassword): rememberMe = True if 'remember-me' in request.form else False login_user(user, remember=rememberMe)