Change the current customer's password
POST
/auth/change-password
Verifies the customer's current password and sets a new one. A wrong current password is 403 WRONG_PASSWORD, never 401: clients treat 401 as an expired session. An account with no password (legacy customers) gets 403 NO_PASSWORD and must use the reset flow. Revokes every refresh token of the customer (all devices) and refuses, with 401, every access token issued before the change; returns a fresh session for the caller in data (same shape as login), so this device stays signed in.
Auth: Bearer JWT required; allowed realms: customer.
Authorizations
bearerAuth
Jeton client obtenu par POST /auth/login (ou /auth/register), renouvelé par POST /auth/refresh.
Type
HTTP (bearer)
Request Body
application/json
JSON "currentPassword": "string", "newPassword": "string"
{
}
Responses
Password changed
application/json
JSON "ok": true, "message": "string", "data": { "token": "string", "refreshToken": "string", "expiresIn": 604800, "customer": { "customerId": "string", "email": "user@example.com", "firstName": "string", "lastName": "string", "phone": "string", "emailVerified": true, "createdAt": "2024-01-01T00:00:00Z" } }
{
}