fix: clear potentially existing user information on auth request for domain discovery (#4528)

This commit is contained in:
Livio Spring
2022-10-11 11:12:07 +02:00
committed by GitHub
parent c0f65088a1
commit 6daf44a34a
@@ -712,9 +712,11 @@ func (repo *AuthRequestRepo) checkDomainDiscovery(ctx context.Context, request *
return false return false
} }
// discovery was allowed, so set the org as requested org // discovery was allowed, so set the org as requested org
// and clear all potentially existing user information and only set the loginname as hint (for registration)
request.SetOrgInformation(org.ID, org.Name, org.Domain, false) request.SetOrgInformation(org.ID, org.Name, org.Domain, false)
request.SetUserInfo("", "", "", "", "", org.ID)
request.LoginHint = loginName request.LoginHint = loginName
request.Prompt = append(request.Prompt, domain.PromptCreate) request.Prompt = append(request.Prompt, domain.PromptCreate) // to trigger registration
return true return true
} }