1

I've been trying to rework an app to use the new session auth system. Everything seems to work fine, however I am not able to use the Navigation (polaris) component successfully.

Let's say I have something like this :

<Navigation.Section
    items={[
        {
            url : '/faq',
            label : translations.faq,
            icon : HintMajor
        }
    ]}
/>

If I only put /faq I am unable to access the route. I am redirected to /auth and get obviously an error.

The only way I manage to make my routes work is to :

  1. Add the shop query in each url like this :
// ...
url : '/faq?shop=${shop}',
// ...
  1. Add every needed routes manually in my server.js WITHOUT the verifyRequest middleware (which does not seem like a good option to me)
// ...
router.get('/faq', handleRequest)
// ...

Can someone explain if I am doing anything wrong ? (I am managing my SESSION_STORAGE with the custom redis storage shown in the repo doc https://github.com/Shopify/shopify-node-api/blob/main/docs/usage/customsessions.md)

Aurélien B.
  • 498
  • 2
  • 9

1 Answers1

0

Are you not supposed to have a wildcard in your App routes so that when you deliver backed end code it is doing just that, and leaving authentication to having the token in your header? No token and a request for anything authenticated and you then direct to login?

David Lazar
  • 10,865
  • 3
  • 25
  • 38
  • In the tutorial and package repo we have something like this : `router.get('(.*)', verifyRequest(), handleRequest) // Everything else must have sessions` But the verifyRequest is causing the issue in my case (which should'nt be the case) – Aurélien B. May 28 '21 at 07:39