FROM CACHE - en_header

Multipass

Solved
Lou-O
New Member
3 0 0

I work for a consulting firm and am testing out Multipass for a large corporate customer. They have hundreds of thousands of customers in their backend DB and don't want to have to create accounts on Shopify for them, seems the perfect use-case for Multipass.

I'm making a quick proof-of-concept using a React frontend with shopify-buy, Azure functions in node for the backend. I have the app running locally and hosted.

But I've run into some problems implementing the Multipass login. 

My frontend makes a request to login/create a customer to my backend Azure function using the multipassify library. This successfully generates a token and a login URL. If I action the URL at the backend the customer account is created, but if I try and use the return URL in my web app, it's blocked by CORS. Unfortunately the Multipass documentation isn't very expansive on this.

Am I doing this wrong, should the frontend even try and process the login URL?

If the multipass login URL should be processed at the backend, how do I go the the hosted checkout without having to get the customer to login (which they can't as they don't have a password, only a token)?

Thanks in advance for any assistance.

Accepted Solution (1)

Accepted Solutions
ashukasma
Shopify Partner
47 11 14

This is an accepted solution.

@Lou-O 

It looks like you are trying to do Ajax call on Shopify MultiPass url

 

https://yourstorename.myshopify.com/account/login/multipass/<MULTIPASS-TOKEN>

You just need to redirect to this url instead of doing any call on this.

Shopify Expert - https://experts.shopify.com/lucentinnovation

View solution in original post

Replies 2 (2)
ashukasma
Shopify Partner
47 11 14

This is an accepted solution.

@Lou-O 

It looks like you are trying to do Ajax call on Shopify MultiPass url

 

https://yourstorename.myshopify.com/account/login/multipass/<MULTIPASS-TOKEN>

You just need to redirect to this url instead of doing any call on this.

Shopify Expert - https://experts.shopify.com/lucentinnovation
Lou-O
New Member
3 0 0

Thanks.

From the docs it looks like you need to make a GET request on it, I misunderstood!