# React SPA B2B onboarding flow using two different Auth0 Applications

**URL:** <https://community.auth0.com/t/react-spa-b2b-onboarding-flow-using-two-different-auth0-applications/189729>\
**Category:** Get Help\
**Tags:** sdks-quickstarts, auth0-react\
**Created:** [July 27, 2025, 6:09pm UTC](https://community.auth0.com/t/react-spa-b2b-onboarding-flow-using-two-different-auth0-applications/189729 "2025-07-27T18:09:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pburr](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pburr/32/75789_2.png) [@pburr](https://community.auth0.com/u/pburr)\
**Post date:** [July 27, 2025, 6:09pm UTC](https://community.auth0.com/t/react-spa-b2b-onboarding-flow-using-two-different-auth0-applications/189729/1 "2025-07-27T18:09:09Z")

</div>

Hey everyone!

I’m building a B2B app using Auth0’s React SDK with AWS Lambda (no express) and JWT auth. My login and sign up flows are split into two Auth0 Applications:

**Login (Application) Client**  
The default client used in the React app (SPA), where users are authenticated in the context of an Organization. It uses the Business Users login experience.

**Signup (Onboarding) Client**  
Used for first-time signup, where users _aren’t_ in an Organization yet, and are authenticated outside of the context of an Auth0 Organization. It’s a Regular Web Application, uses the Individuals login experience, and is handled server-side.

The current onboarding flow is:

1. User enters email and clicks “Get Started”.
2. App constructs the Onboarding client’s `/authorize` URL with `redirect_uri` poitning to a server-side endpoint.
3. The server-side endpoint validates the access and ID tokens and redirects back to my React app a different page (user is authenticated at this point)
4. User entier their Organization name, triggering another server endpoint that:
  - Creates a new Auth0 Organization using a scoped M2M application,
  - Adds user as a member of the new organization
  - Redirects to the Application client’s `/authorize` with the `organization` parameter set.

**For step 3**  
I’m struggling to find the best way to check if the user is authenticated at this point, and redirect to sign-in if not. Would it be better to use `auth0-spa-js` for the Onboarding client (instead of manually building the `authorize` URL), so I could use `checkSession`?

**For step 4**  
After accepting organization membership, I’m redirected back to the sign-in screen instead of into the app. But if click the “Login” button, I’m fully signed in and redirected to the app. Is there a recommended way to bridge this, so the user lands in into the app under the organization context without an extra login?

Any advice would be much appreciated!

---

<div class="post-metadata">

**Author:** ![alison23taylor](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alison23taylor/32/75586_2.png) [@alison23taylor](https://community.auth0.com/u/alison23taylor)\
**Post date:** [July 28, 2025, 12:02pm UTC](https://community.auth0.com/t/react-spa-b2b-onboarding-flow-using-two-different-auth0-applications/189729/2 "2025-07-28T12:02:56Z")

</div>

Your current setup with separate Auth0 applications for login and signup is a common pattern for B2B multi-tenancy. For step 3, using `auth0-spa-js` for your Onboarding client is highly recommended. It simplifies token validation and state management, and `checkSession` is indeed the correct method to verify user authentication without a full redirect. This will allow you to gracefully handle unauthenticated users. For step 4, the redirect to the sign-in screen after organization acceptance suggests that the session established by the Onboarding client isn’t seamlessly transferring to the Application client. The recommended approach here is to leverage Auth0’s OIDC conformant behavior. After successfully adding the user to the organization, instead of redirecting to the Application client’s `/authorize` with just the `organization` parameter, you should trigger a silent authentication flow (e.g., using `checkSession` with the `organization` parameter) from your React app once it loads. This will obtain new tokens scoped to the user’s new organization, effectively bridging the two sessions without an extra login step for the user.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 11, 2025, 12:03pm UTC](https://community.auth0.com/t/react-spa-b2b-onboarding-flow-using-two-different-auth0-applications/189729/3 "2025-08-11T12:03:20Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
