Login stopped working in hydrogen app

Topic summary

A Hydrogen app’s login functionality suddenly stopped working without any code changes, throwing an atob() invalid base64 error during the authorization process.

Error Details:

  • Occurs when using the new login method
  • Error originates from decodeJwt function in Hydrogen’s development index
  • Happens during local development accessed via ngrok

Investigation & Resolution:

  • Another user reported the same issue on GitHub around the same time (issue #8429)
  • The developer hadn’t modified login flow code, only worked on design
  • GitHub issue was marked as a bug and acknowledged by the Hydrogen team
  • Issue appears resolved - login now works again for the original reporter

The problem seemed to be server-side or package-related rather than code-specific, as it affected multiple users simultaneously and resolved without local code changes.

Summarized with AI on November 6. AI used: claude-sonnet-4-5-20250929.

Login stopped working for me between the morning and evening yesterday, without me changing my code.

I get this error when trying to log in (Using the new login method).

Unexpected Server Error

Error: atob() called with invalid base64-encoded data. (Only whitespace, '+', '/', alphanumeric ASCII, and up to two terminal '=' signs when the input data length is divisible by 4 are allowed.)
    at decodeJwt (C:/Users/robin/Documents/Projects/sagostenar/node_modules/@shopify/hydrogen/dist/development/index.js:2442:36)
    at getNonce (C:/Users/robin/Documents/Projects/sagostenar/node_modules/@shopify/hydrogen/dist/development/index.js:2438:10)
    at Object.authorize (C:/Users/robin/Documents/Projects/sagostenar/node_modules/@shopify/hydrogen/dist/development/index.js:2813:35)
    at callRouteLoader (C:/Users/robin/Documents/Projects/sagostenar/node_modules/.vite/deps_ssr/@remix-run_server-runtime.js:3214:16)
    at C:/Users/robin/Documents/Projects/sagostenar/node_modules/.vite/deps_ssr/@remix-run_server-runtime.js:1985:21
    at callLoaderOrAction (C:/Users/robin/Documents/Projects/sagostenar/node_modules/.vite/deps_ssr/@remix-run_server-runtime.js:2045:16)
    at async Promise.all (index 2)
    at callDataStrategyImpl (C:/Users/robin/Documents/Projects/sagostenar/node_modules/.vite/deps_ssr/@remix-run_server-runtime.js:1939:17)
    at callDataStrategy (C:/Users/robin/Documents/Projects/sagostenar/node_modules/.vite/deps_ssr/@remix-run_server-runtime.js:1834:19)
    at loadRouteData (C:/Users/robin/Documents/Projects/sagostenar/node_modules/.vite/deps_ssr/@remix-run_server-runtime.js:1816:19)

I’m building my app on top of the skeleton template, and I’ve mainly done pure design work to this point, I haven’t touched the login flow at all.

I could be mistaken of course, but I saw other user reporting the same issue on github around the same time: https://github.com/Shopify/hydrogen/issues/2498

@arrpii
If code is unchanged then it must be an issue with server end packages. See if anyone has change anything recently on server side. Any plugin/packages updates

Thanks for the quick reply. I’m getting this error when running locally and accessing my app through ngrok. It’s a personal project so I’m the only developer. I’ll keep investigating when I’m back home. Any more insights are welcome!

Small update: the github issue has been marked as a bug and they say they are working on it.

1 Like

This issue seem to have been resolved, it now works for me at least. :raising_hands:

If anyone still has this issue maybe make a new thread so it can be tracked further.