Update Password
API Description
- Path:
/client/member/update-password - Method:
POST - Description: Update the password for the currently logged-in member. This API requires the member's exclusive Token in the request header for authentication.
Request Parameters
Header Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Authorization | String | Yes | Format: Bearer <token>, where <token> is obtained after a successful login or registration. |
Body Parameters (JSON or Form Data)
| Parameter | Type | Required | Description |
|---|---|---|---|
oldPassword | String | Yes | The current password |
newPassword | String | Yes | The new password |
confirmPassword | String | Yes | Confirm the new password (must match newPassword) |
Request Example
http
POST /client/member/update-password HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR...
Content-Type: application/json
{
"oldPassword": "old_password_123",
"newPassword": "new_password_456",
"confirmPassword": "new_password_456"
}Response Parameters
| Parameter | Type | Description |
|---|---|---|
code | Number | Status code, 0 means success |
msg | String | Response message |
data | Object | Empty object {} or null on success |
Response Example
Success
json
{
"code": 0,
"msg": "success",
"data": {}
}Failure (Passwords do not match)
json
{
"code": 7,
"msg": "newPassword and confirmPassword do not match",
"data": {}
}Failure (Invalid Old Password)
json
{
"code": 7,
"msg": "invalid old password",
"data": {}
}