All things Shopify and commerce
I'm running into some major issues using the Multipass API to authenticate users on our Shopify+ storefront from an outside source. I'm using a simple Next.js API function as my endpoint to call Multipass using Shopify's suggested Node.js package, `multipassify`. I also attempted to use a newer NPM package called `multipass-js` but no luck there either.
Basically, no matter how I construct my encrypted/encoded token URL I receive a 422 error from the Multipass endpoint with little context into the specifics of the issue. It simply says "Invalid Multipass request", and I can tell the error from the server is a 422.
I've already confirmed that my `MULTIPASS_SECRET` and `WEBSITE_URL` are both matching, correct values, and the multipass URL passed back from the API appears to be properly constructed as well. Here's an example URL for reference: `https://made-by-haven-staging.myshopify.com/account/login/multipass/VAv-e4CWHxBgIuDf1JUvNV74QYJoWMIP... I've even attempted to set the base URL to our primary TLD instead of the .myshopify.com URL to see if that has any effect. No luck.
Also, I've tried using a simple `window.location.href` redirect to the new tokenized login URL as well as a GET call using the fetch api, but neither one seems to have any impact on the 422 error that Shopify returns. Similarly, I thought my issue could be CORS-related since I was working on `localhost` for my initial tests, but after deploying to a subdomain of our main site the issue continues to persist.
Here's a look at the API function that I constructed to generated the tokenized URL:
multipass serverless function
For extra context, you can check out my dumb client app to help test things out. Use `colin.darland@gmail.com` to be certain you're posting an email with an active user account: https://staging-api.hineighbor.com/
Any feedback or suggestions would be freaking awesome. I'm stumped on this one.
I hope you figured it out, but you need created_at: ISODateFormat along with email. Get rid of the IP as well, it always caused issues for me.
Did you ever figure this out? I'm running into the same thing.
Try using "hydropass" npm package if you are using hydrogen storefront. It is working in my case.
https://www.npmjs.com/package/hydropass
Try using "hydropass" npm package if you are using hydrogen storefront. It is working in my case.
https://www.npmjs.com/package/hydropass
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025