Centralized identity provider for all Acme apps
The user now lands on the /idp route. Before initializing the OAuth flow, an active session must exist on accounts.acme.com. If a session does not exist (as we will assume in this example), the user will be redirected to /login to create a session.
Acme Accounts could not find a session.
//Use Stytch method to check for valid session
const { member } = useStytchMember();
if (!member) {
const loginURL = "/login?returnTo=${window.location.toString()}"
return <Redirect to={loginURL} />
}
return <B2BIdentityProvider />