Resets the password using a token received via email. Returns a JWT token on success (auto-login).
JavaScript
import { createClient } from '@spree/sdk' const client = createClient({ baseUrl: 'https://your-store.com', publishableKey: '<api-key>', }) const auth = await client.passwordResets.update( 'reset-token-from-email', { password: 'newsecurepassword', password_confirmation: 'newsecurepassword', } )
{ "token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjU0OWVlY2ZjLTBkNDItNDM3Mi1iZjIxLWU1YmEzNzg5YTUwMyIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc0NzAxODYyfQ.44KXETRVeBoqXrhWqHlILPqKsplefc2L5Pq6KCPbOZs", "refresh_token": "a4CSEMEK99SqC2oZE68EJZit", "user": { "id": "cus_UkLWZg9DAJ", "email": "customer@example.com", "first_name": "Sonya", "last_name": "Mraz", "phone": null, "accepts_email_marketing": false, "available_store_credit_total": "0", "display_available_store_credit_total": "$0.00", "addresses": [], "default_billing_address": null, "default_shipping_address": null } }
Publishable API key for store access
Password reset token from the email
6
"newsecurepassword"
password reset successful
JWT access token
Refresh token for obtaining new access tokens
Show child attributes
Was this page helpful?