Why does it keep redirecting to login

Hello
I am new to developing Shopify plugins, and I keep running into an issue. When I submit a form, it keeps redirecting me to “login“. I was following this tutorial: Build a Shopify app using React Router , and I even went ahead and downloaded that repo GitHub - Shopify/example-app--qr-code--remix and the same problem occurred using 100% that code.

The steps I took, was:

  1. Download the repo
  2. Npm install
  3. shopify app dev
  4. Choose “new shopify app”
  5. Press “p“ to preview, and then created a QR code.

Som additional informail:

  1. I am using version 2025-10, but it also occurs on other versions
  2. The qr code is created even though I am redirected to the login page
  3. Looking at the log, it seems like the first requests have shop: null, and says redirecting to login page, but then the following requests says “session is valid”. I also added logging in the form code, and could see that the form code was happening after the “invalid“.
  4. When above is said, I could also get it somewhat to work if I commented out all other authenticate than the one in the form, and it didn’t matter which I re-added.

I hope somebody can point me in the right direction so I don’t run into this issue.

You can try adding event.preventDefault(); to the handleSave function in the app.qrcodes.$id.jsx file.

Hi there!
@FrederikET did you fund a solution?
I’ve faced the very same behavior.

What I’ve also noticed:
when I’m clicking on “Save“ or on “Create QR Code“ (that should be an App Bridge part if I’m not wrong), then in app logs I see this:

”[shopify-app/INFO] Authenticating admin request | {shop: null}”

When I’m clicking on App page - instead of null I can see the my dev store name

found a solution

Great that the event.preventDefault() solves it @long_en @Romanenko_Sviatoslav. Thank you for taking the time to respond

Personally, I ended up creating my app using PHP / Laravel, which I am way more proficient in.