2fa-1.2
This commit is contained in:
		
							parent
							
								
									9b4bd725da
								
							
						
					
					
						commit
						e2d0e7a95e
					
				
							
								
								
									
										5
									
								
								app.py
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								app.py
									
									
									
									
									
								
							| @ -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']) | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user