forked from baron/baron-sso
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -1817,6 +1817,7 @@ func collectEmailList(traits map[string]any, primaryEmail string) []string {
|
||||
|
||||
func buildIdentityLookupCandidates(loginID string) []string {
|
||||
seen := make(map[string]struct{})
|
||||
candidates := make([]string, 0, 3)
|
||||
add := func(value string) {
|
||||
candidate := strings.TrimSpace(value)
|
||||
if candidate == "" {
|
||||
@@ -1826,6 +1827,7 @@ func buildIdentityLookupCandidates(loginID string) []string {
|
||||
return
|
||||
}
|
||||
seen[candidate] = struct{}{}
|
||||
candidates = append(candidates, candidate)
|
||||
}
|
||||
|
||||
normalized := strings.TrimSpace(loginID)
|
||||
@@ -1837,10 +1839,6 @@ func buildIdentityLookupCandidates(loginID string) []string {
|
||||
add(normalizePhoneForLoginID(normalized))
|
||||
}
|
||||
|
||||
candidates := make([]string, 0, len(seen))
|
||||
for candidate := range seen {
|
||||
candidates = append(candidates, candidate)
|
||||
}
|
||||
return candidates
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user