resetPassword - JS SDK Auth Reference

This documentation provides a reference to the sdk.auth.resetPassword method used to send requests to Medusa's Authentication API routes. It can be used for admin users, customers, or custom actor types.

This method requests a reset password token for an admin user, customer, or custom actor type. It sends a request to the Generate Reset Password Token API route.

To reset the password later using the token delivered to the user, use the updateProvider method.

Related guide: How to allow customers to reset their passwords in a storefront.

Example#

Code
1sdk.auth.resetPassword(2  "customer",3  "emailpass",4  {5    identifier: "customer@gmail.com"6  }7)8.then(() => {9  // user receives token10})

Parameters#

actorstring
The actor type. For example, user for admin user, or customer for customer.
providerstring
The authentication provider to use. For example, emailpass.
bodyobject
The data required to identify the user.

Returns#

PromisePromise<void>
This method requests a reset password token for an admin user, customer, or custom actor type. It sends a request to the Generate Reset Password Token API route. To reset the password later using the token delivered to the user, use the updateProvider method. Related guide: How to allow customers to reset their passwords in a storefront.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break