The purpose of onboarding page is to render the form to collect the information required to onboard a user in SafeDep Cloud and create a tenant for the user. This is a post-auth operation i.e. available only after authentication with Auth0 is completed.
After authentication we need to check if user is authenticated and if so, redirect user to /onboard which is our post-auth tenant on-boarding page.
Update src/app/page.tsx to check if user is already authenticated using Auth0 Nextjs SDK
If user is not authenticated, continue with redirect to /auth (existing behaviour)
If user is authenticated, redirect user to /onboard page (new behaviour)
When the on-boarding form is submitted, it should invoke a server action onboardUserTenant() which is empty function for now, to be implemented in a future task
/onboard should be protected by authentication i.e. if an unauthenticated user navigates to /onboard, they should be redirected to /
The purpose of onboarding page is to render the form to collect the information required to onboard a user in SafeDep Cloud and create a tenant for the user. This is a post-auth operation i.e. available only after authentication with Auth0 is completed.
After authentication we need to check if user is authenticated and if so, redirect user to
/onboard
which is our post-auth tenant on-boarding page.src/app/page.tsx
to check if user is already authenticated using Auth0 Nextjs SDK/auth
(existing behaviour)/onboard
page (new behaviour)onboardUserTenant()
which is empty function for now, to be implemented in a future task/onboard
should be protected by authentication i.e. if an unauthenticated user navigates to/onboard
, they should be redirected to/
See more information about server actions: https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations#forms
Wireframe for
/onboard
is given belowRef: