updateProvider - JS SDK Auth Reference

This documentation provides a reference to the sdk.auth.updateProvider 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 is used to update user-related data authentication data.

More specifically, use this method when updating the password of an admin user, customer, or custom actor type after requesting to reset their password with resetPassword.

This method sends a request to this API route.

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

Example#

Code
1sdk.auth.updateProvider(2  "customer",3  "emailpass",4  {5    password: "supersecret"6  },7  token8)9.then(() => {10  // password updated11})

Parameters#

actorstring
The actor type. For example, user for admin user, or customer for customer.
providerstring
The authentication provider to use. For example, emailpass.
The data necessary to update the user's authentication data. When resetting the user's password, send the password property.
tokenstring

Returns#

PromisePromise<void>
This method is used to update user-related data authentication data. More specifically, use this method when updating the password of an admin user, customer, or custom actor type after requesting to reset their password with resetPassword. This method sends a request to this API route. 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