mirror of https://github.com/h44z/wg-portal.git
				
				
				
			improve logging of LDAP login process (#529)
This commit is contained in:
		
							parent
							
								
									7cd7d13dc7
								
							
						
					
					
						commit
						afb38b685c
					
				|  | @ -364,6 +364,7 @@ func (a *Authenticator) passwordAuthentication( | ||||||
| 			} | 			} | ||||||
| 			ldapUserInfo, err = ldapAuth.ParseUserInfo(rawUserInfo) | 			ldapUserInfo, err = ldapAuth.ParseUserInfo(rawUserInfo) | ||||||
| 			if err != nil { | 			if err != nil { | ||||||
|  | 				slog.Error("failed to parse ldap user info", "identifier", identifier, "error", err) | ||||||
| 				continue | 				continue | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
|  | @ -376,10 +377,13 @@ func (a *Authenticator) passwordAuthentication( | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if userSource == "" { | 	if userSource == "" { | ||||||
|  | 		slog.Warn("no user source found for user", "identifier", identifier, "ldapProviderCount", a.ldapAuthenticators) | ||||||
| 		return nil, errors.New("user not found") | 		return nil, errors.New("user not found") | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if userSource == domain.UserSourceLdap && ldapProvider == nil { | 	if userSource == domain.UserSourceLdap && ldapProvider == nil { | ||||||
|  | 		slog.Warn("no ldap provider found for user", | ||||||
|  | 			"identifier", identifier, "ldapProviderCount", a.ldapAuthenticators) | ||||||
| 		return nil, errors.New("ldap provider not found") | 		return nil, errors.New("ldap provider not found") | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue