This repository was archived by the owner on Oct 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 88
This repository was archived by the owner on Oct 27, 2025. It is now read-only.
[Bug]: Error multiple user found when setting organization id #587
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingloginLogin ApplicationLogin Applicationpresentation-layer
Description
Preflight Checklist
- I could not find a solution in the documentation, the existing issues or discussions
- I have joined the ZITADEL chat
Version
No response
Describe the problem caused by this bug
When 2 user have same email address in 2 organizations and we try to login by setting scope urn:zitadel:iam:org:id:<org id> we have the error "Multiple users found."
To reproduce
- create a first org
- add a user with a random email
- create second org
- add a user with exact same email as step 2
- try login by setting scope
urn:zitadel:iam:org:id:<org id>to precisely select the wanted org
Screenshots
example with a curl request i've made:
☁ curl 'https://login.saas-office.io/ui/v2/login/loginname?requestId=oidc_V2_335268004772203028^&organization=321701383159940852' \
-X POST \
//[ ...]
--data-raw '[{"loginName":"arthur.halet@saas-office.com","organization":"321701383159940852","requestId":"oidc_V2_335268004772203028","suffix":"$undefined"}]'
0:{"a":"$@1","f":"","b":"C951oDh4qF5LY-oeWKSBp"}
1:{"error":"Multiple users found."}
Expected behavior
I want the exact same behavior as login v1 which take user from the requested org
Relevant Configuration
No response
Additional Context
I've looked at the code and this part seems in cause, it build a queries but it is never used during search. By the way queries is set at the beginning of this function but it is never used.
simply change this code:
queries.push(
create(SearchQuerySchema, {
query: {
case: "organizationIdQuery",
value: {
organizationId,
},
},
}),
);
to
emailAndPhoneQueries.push(
create(SearchQuerySchema, {
query: {
case: "organizationIdQuery",
value: {
organizationId,
},
},
}),
);
should fix but it currently heavy work to me to setup everything to test this code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingloginLogin ApplicationLogin Applicationpresentation-layer
Type
Projects
Status
✅ Done