Create protected routes on the Polaris3 + Next.js tutorial

Shopify Partner
18 0 10

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.


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.




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


Reply 1 (1)

Shopify Staff
1561 81 341

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.

Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog