Create protected routes on the Polaris3 + Next.js tutorial

Shopify Partner
14 0 4

Issue summary

 

I am using this example from the React + Apollo + Next tutorial and I cannot figure out how to implement a behaviour which redirects the user to onboarding if he hasn't gone through onboarding yet.

https://github.com/Shopify/shopify-demo-app-node-react

 

Expected behavior

 

  1. A user opens my app on Shopify
  2. If the user has already gone through Onboarding then continue to the Dashboard.
  3. If the user hasn't gone through Onboarding, send his to the Onboarding page.
  4. This logic should run for every page in the system and it should work on server as well as on client.

 

Question

 

Any example on how to achieve the requested behaviour with the provided tutorial would be awesome.

Thanks

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1555 80 255

This sounds like some really good feedback for the maintainers of the tutorial. I would recommend creating an issue in the repository to both ask for an example and perhaps request they work that into the example codebase. If I was proficient enough with NextJS + Node I'd offer some more assistance, so my apologies for the bare answer.

0 Likes