mirror of
https://github.com/zadam/trilium.git
synced 2024-12-27 09:43:18 +08:00
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)
This commit is contained in:
parent
c06c837904
commit
1f19c9cd0d
1 changed files with 3 additions and 6 deletions
|
@ -54,11 +54,8 @@ documentPath = config['Document']['documentPath']
|
||||||
|
|
||||||
connect(documentPath)
|
connect(documentPath)
|
||||||
|
|
||||||
hashedPassword = password_provider.getPasswordHash()
|
def verify_password(guessed_password):
|
||||||
|
hashed_password = binascii.unhexlify(password_provider.getPasswordHash())
|
||||||
|
|
||||||
def verify_password(hex_hashed_password, guessed_password):
|
|
||||||
hashed_password = binascii.unhexlify(hex_hashed_password)
|
|
||||||
|
|
||||||
guess_hashed = my_scrypt.getVerificationHash(guessed_password)
|
guess_hashed = my_scrypt.getVerificationHash(guessed_password)
|
||||||
|
|
||||||
|
@ -68,7 +65,7 @@ def verify_password(hex_hashed_password, guessed_password):
|
||||||
def login_post():
|
def login_post():
|
||||||
guessedPassword = request.form['password'].encode('utf-8')
|
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
|
rememberMe = True if 'remember-me' in request.form else False
|
||||||
|
|
||||||
login_user(user, remember=rememberMe)
|
login_user(user, remember=rememberMe)
|
||||||
|
|
Loading…
Reference in a new issue