Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hey everyone,
I'm looking for help in using the customerResetByUrl mutation on the Storefront API.
https://help.shopify.com/en/api/storefront-api/reference/mutation/customerresetbyurl
After a bit of debugging, I finally figured out that customerResetByUrl takes the default Shopify password reset URL, also known as the resetUrl. This is the same URL set within the password reset email template. However, I'm confused how this is expected to be used.
Is customerResetByUrl intended to be used programmatically? I'm trying to build the password reset flow on my own site without the user going to Shopify at all. So ideally, I'm trying to force the password reset link to point to my own server without modifying the email template. Is this possible?
It seems I have no way of accessing resetUrl via the API. The only place I see resetUrl is within the password reset email. There must be something I'm missing, otherwise how would you even use this mutation without access to resetUrl?
Any direction would be much appreciated!
Solved! Go to the solution
This is an accepted solution.
Hey @andrewrobbins As i'm sure you know - the format of the URL is your-domain.com/account/reset/{{ customer-id }}/{{ reset-token }} at this time there is no way to pull this from the API, however, I will pass along your feedback with the use case.
To learn more visit the Shopify Help Center or the Community Blog.
Really need some help here, any thoughts?
You are on the right track. In order to get the reset URL to point to your app you will need to modify the liquid template. Can I ask why you would like to avoid doing this? That way, you can redirect the customer to the proper link.
The flow would be similar to the following:
customerRecover
mutationcustomerRecover
mutation sends an email to them with reset instructionscustomer.reset_password_url
liquid variable.customerResetByUrl
mutation
To learn more visit the Shopify Help Center or the Community Blog.
Hey @vix
Thanks for the response!
I'm doing exactly the steps you listed and it's working great as is.
The reason I'd like to eliminate the liquid modification step is because my app requires end users to make this tweak on their own—many of whom are without any developer experience.
I could create a tutorial in my documentation, but it would really improve the UX flow of using my product if I could just handle it for them programmatically.
Perhaps an API endpoint that would allow me to filter the domain of the customer.reset_password_url value directly?
This is an accepted solution.
Hey @andrewrobbins As i'm sure you know - the format of the URL is your-domain.com/account/reset/{{ customer-id }}/{{ reset-token }} at this time there is no way to pull this from the API, however, I will pass along your feedback with the use case.
To learn more visit the Shopify Help Center or the Community Blog.
Hi there. Is there any update about this? I am facing now the same problem now
Hi Andrew,
Trying to get the customerRecover mutation working, I am trying with postman and for the life of me, I can't get it to work.
The error that I am getting is this :