From 73bbffccaa66769204de818e349a69fea95d22a8 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 28 Jul 2019 21:29:54 +0200 Subject: [PATCH] Fix for login issue on MacOS --- cps/opds.py | 2 +- cps/web.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/opds.py b/cps/opds.py index 657b3861..d2072313 100644 --- a/cps/opds.py +++ b/cps/opds.py @@ -288,7 +288,7 @@ def check_auth(username, password): username=username.encode('windows-1252') user = ub.session.query(ub.User).filter(func.lower(ub.User.nickname) == username.decode('utf-8').lower()).first() - return bool(user and check_password_hash(user.password, password)) + return bool(user and check_password_hash(str(user.password), password)) def authenticate(): diff --git a/cps/web.py b/cps/web.py index b5bff2b3..687c144a 100644 --- a/cps/web.py +++ b/cps/web.py @@ -1115,7 +1115,7 @@ def login(): log.info('LDAP Login failed for user "%s" IP-adress: %s', form['username'], ipAdress) flash(_(u"Wrong Username or Password"), category="error") else: - if user and check_password_hash(user.password, form['password']) and user.nickname != "Guest": + if user and check_password_hash(str(user.password), form['password']) and user.nickname != "Guest": login_user(user, remember=True) flash(_(u"You are now logged in as: '%(nickname)s'", nickname=user.nickname), category="success") return redirect_back(url_for("web.index"))