This commit is contained in:
aitzol 2023-11-24 08:15:40 +01:00
parent 9b4bd725da
commit e2d0e7a95e
1 changed files with 1 additions and 4 deletions

5
app.py
View File

@ -523,16 +523,13 @@ def login_user_ldap(conf, username, password):
# Note: raises LDAPUserNameIsMandatoryError when user_dn is None.
with connect_ldap(conf, authentication=SIMPLE, user=user_dn, password=password) as c:
c.bind()
print('USERDN:', user_dn)
if is_trusted_device(conf, user_dn):
newSession().set(get_user_data(user_dn, c))
#newSession().get()['id'] = tools.session_id()
newSession().data['id'] = tools.session_id()
print(newSession().data)
#update timestamp + ip address
update_login_info(conf, user_dn)
LOG.debug("%s logged in to %s" % (username, conf['base']))
#check if exists 2fa qr image
#generate qr if it doenst exists when 2fa enable
if(newSession().get()['secureAuth']):
tools.gen_qr(newSession().get()['authToken'])