Setup Next.js Route Guard to redirect users if they haven't completed wizard
Unanswered
Silky ant posted this in #help-forum
Silky antOP
Context: I'm designing the front-end of an
1. Creating an organization
2. Invite members to this organization (optional)
3. Choose a plan (paid)
4. Enter payment information
Problem:
Currently, the user can "interrupt" this wizard and navigate to any other pages or links on the website. What can Next.js do for the
onboarding wizard where the user must complete 4 steps:1. Creating an organization
2. Invite members to this organization (optional)
3. Choose a plan (paid)
4. Enter payment information
Problem:
Currently, the user can "interrupt" this wizard and navigate to any other pages or links on the website. What can Next.js do for the
/onboarding route to make sure the user can't navigate until they've completed all 4 steps?6 Replies
like a DB table
that tells if the user is onboarded
and if not, other pages will redirect back
you can do the redirection with somehting like middleware
@!=tgt set something on the backend
Silky antOP
Hmm unfortunately, I don't work on the backend.
Right now I'm setting a condition that redirects the user if
How would I use the middleware to do redirection?
Right now I'm setting a condition that redirects the user if
(!orgs) no orgs exist.How would I use the middleware to do redirection?