This commit is contained in:
aitzol 2023-11-24 08:15:40 +01:00
parent 9b4bd725da
commit e2d0e7a95e

5
app.py
View File

@ -523,16 +523,13 @@ def login_user_ldap(conf, username, password):
# Note: raises LDAPUserNameIsMandatoryError when user_dn is None. # Note: raises LDAPUserNameIsMandatoryError when user_dn is None.
with connect_ldap(conf, authentication=SIMPLE, user=user_dn, password=password) as c: with connect_ldap(conf, authentication=SIMPLE, user=user_dn, password=password) as c:
c.bind() c.bind()
print('USERDN:', user_dn)
if is_trusted_device(conf, user_dn): if is_trusted_device(conf, user_dn):
newSession().set(get_user_data(user_dn, c)) newSession().set(get_user_data(user_dn, c))
#newSession().get()['id'] = tools.session_id()
newSession().data['id'] = tools.session_id() newSession().data['id'] = tools.session_id()
print(newSession().data)
#update timestamp + ip address #update timestamp + ip address
update_login_info(conf, user_dn) update_login_info(conf, user_dn)
LOG.debug("%s logged in to %s" % (username, conf['base'])) 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']): if(newSession().get()['secureAuth']):
tools.gen_qr(newSession().get()['authToken']) tools.gen_qr(newSession().get()['authToken'])