Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Log in to specific organization #1213

Open
kevinmitch14 opened this issue Jan 23, 2025 · 0 comments
Open

[Feature Request]: Log in to specific organization #1213

kevinmitch14 opened this issue Jan 23, 2025 · 0 comments

Comments

@kevinmitch14
Copy link
Contributor

kevinmitch14 commented Jan 23, 2025

AFAIK it is not possible to sign in to a specific organization. (unless you use provider: "authkit" which we don't want to use right now, we are using a custom flow.) We are also only using magic auth.

Use case:
We have a multi-tenant app, each tenant lives on a subdomain. It would be great to be able to log into tenant1 if we are on tenant1's domain. This usually works okay:

  • When the user is only part of tenant1
  • When the user is part of tenant1 and tenant2, we can let the log in fail (organization_selection_required) and then use the subdomain to select the correct organization.
  • When the user is part of tenant1 and has a pending invite to tenant2 (not necessary, just the example I came across) and tries to log in on tenant2 subdomain, it will log in to tenant1 workos organization without the organization_selection_required error.

How should we go about managing this? Right now, before creating a magic auth, we check the organization members to see if they exist and they have status of active. And if so, send a code, if not don't send code. And we display a message saying "if you are member you will receive code...". We know the organizationId before initiating a log in, so it would be great to be able to just provide this when creating the magic auth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant