Fix for login issue on MacOS

pull/994/head
Ozzieisaacs 5 years ago
parent f59d9d5aa8
commit 73bbffccaa

@ -288,7 +288,7 @@ def check_auth(username, password):
username=username.encode('windows-1252') username=username.encode('windows-1252')
user = ub.session.query(ub.User).filter(func.lower(ub.User.nickname) == user = ub.session.query(ub.User).filter(func.lower(ub.User.nickname) ==
username.decode('utf-8').lower()).first() 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(): def authenticate():

@ -1115,7 +1115,7 @@ def login():
log.info('LDAP Login failed for user "%s" IP-adress: %s', form['username'], ipAdress) log.info('LDAP Login failed for user "%s" IP-adress: %s', form['username'], ipAdress)
flash(_(u"Wrong Username or Password"), category="error") flash(_(u"Wrong Username or Password"), category="error")
else: 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) login_user(user, remember=True)
flash(_(u"You are now logged in as: '%(nickname)s'", nickname=user.nickname), category="success") flash(_(u"You are now logged in as: '%(nickname)s'", nickname=user.nickname), category="success")
return redirect_back(url_for("web.index")) return redirect_back(url_for("web.index"))

Loading…
Cancel
Save