import Switchyard from "@switchyard/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.auth.updateProvider(
"user",
"emailpass",
{
password: "supersecret"
},
token
)
.then(() => {
// password updated
}){
"success": true
}Reset an admin user’s password using a reset-password token generated with the Generate Reset Password Token API route. You pass the token as a bearer token in the request’s Authorization header.
import Switchyard from "@switchyard/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.auth.updateProvider(
"user",
"emailpass",
{
password: "supersecret"
},
token
)
.then(() => {
// password updated
}){
"success": true
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The provider used for authentication.
"emailpass"
The input data necessary for authentication. For example, for email-pass authentication, pass email and password properties.
OK
Details on the reset password's status.
Whether the password was reset successfully.