Hi,
Im trying to achieve the out-of-the-box flow which user type his credentials and then he should be prompt to organization picker component (if his email is connected to multiple organizations)
I created 2 organizations and added user with same email to both
for some reason when I submit with credentials it loges me in to the first organization.
any idea why? maybe Im missing something
Im using react with typescript, here is a snippet:
main.tsx
<Auth0Provider
domain="xxx"
clientId="yyy"
authorizationParams={{
redirect_uri: window.location.origin
}}
>
<App />
</Auth0Provider>
App.tsx:
function App() {
const { logout, loginWithRedirect, user, isAuthenticated, isLoading } =
useAuth0()
if (isLoading) {
return <div>Loading ...</div>
}
if (isAuthenticated && user) {
return (
<div>
<img
src={user.picture}
alt={user.name}
/>
<h2>{user.name}</h2>
<p>{user.email}</p>
<p>{JSON.stringify(user)}</p>
<button onClick={() => logout({})}>Log Out</button>
</div>
)
}
return <button onClick={() => loginWithRedirect()}>Log In</button>
}
export default App
here some of the configurations: