Revert accidentally committed store user session

This commit is contained in:
Ozzie Isaacs 2021-07-30 10:16:52 +02:00
parent 0ec2bcd897
commit e245a147d9

View File

@ -1523,7 +1523,7 @@ def login():
login_result, error = services.ldap.bind_user(form['username'], form['password']) login_result, error = services.ldap.bind_user(form['username'], form['password'])
if login_result: if login_result:
login_user(user, remember=bool(form.get('remember_me'))) login_user(user, remember=bool(form.get('remember_me')))
ub.store_user_session() #ub.store_user_session()
log.debug(u"You are now logged in as: '%s'", user.name) log.debug(u"You are now logged in as: '%s'", user.name)
flash(_(u"you are now logged in as: '%(nickname)s'", nickname=user.name), flash(_(u"you are now logged in as: '%(nickname)s'", nickname=user.name),
category="success") category="success")
@ -1531,7 +1531,7 @@ def login():
elif login_result is None and user and check_password_hash(str(user.password), form['password']) \ elif login_result is None and user and check_password_hash(str(user.password), form['password']) \
and user.name != "Guest": and user.name != "Guest":
login_user(user, remember=bool(form.get('remember_me'))) login_user(user, remember=bool(form.get('remember_me')))
ub.store_user_session() #ub.store_user_session()
log.info("Local Fallback Login as: '%s'", user.name) log.info("Local Fallback Login as: '%s'", user.name)
flash(_(u"Fallback Login as: '%(nickname)s', LDAP Server not reachable, or user not known", flash(_(u"Fallback Login as: '%(nickname)s', LDAP Server not reachable, or user not known",
nickname=user.name), nickname=user.name),
@ -1561,7 +1561,7 @@ def login():
else: else:
if user and check_password_hash(str(user.password), form['password']) and user.name != "Guest": if user and check_password_hash(str(user.password), form['password']) and user.name != "Guest":
login_user(user, remember=bool(form.get('remember_me'))) login_user(user, remember=bool(form.get('remember_me')))
ub.store_user_session() # ub.store_user_session()
log.debug(u"You are now logged in as: '%s'", user.name) log.debug(u"You are now logged in as: '%s'", user.name)
flash(_(u"You are now logged in as: '%(nickname)s'", nickname=user.name), category="success") flash(_(u"You are now logged in as: '%(nickname)s'", nickname=user.name), category="success")
config.config_is_initial = False config.config_is_initial = False
@ -1585,7 +1585,7 @@ def login():
@login_required @login_required
def logout(): def logout():
if current_user is not None and current_user.is_authenticated: if current_user is not None and current_user.is_authenticated:
ub.delete_user_session(current_user.id, flask_session.get('_id',"")) # ub.delete_user_session(current_user.id, flask_session.get('_id',""))
logout_user() logout_user()
if feature_support['oauth'] and (config.config_login_type == 2 or config.config_login_type == 3): if feature_support['oauth'] and (config.config_login_type == 2 or config.config_login_type == 3):
logout_oauth_user() logout_oauth_user()