curl -X POST https://api-verifier-2.onrender.com/password-change \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token>" \
-d '{
"currentPassword": "oldpassword123",
"newPassword": "newpassword456"
}'
{
"success": true,
"message": "Password changed successfully"
}
{
"error": "New password must be different from current password"
}
{
"error": "Current password is incorrect"
}
Authentication
Change password
Change password for authenticated users
POST
/
password-change
curl -X POST https://api-verifier-2.onrender.com/password-change \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token>" \
-d '{
"currentPassword": "oldpassword123",
"newPassword": "newpassword456"
}'
{
"success": true,
"message": "Password changed successfully"
}
{
"error": "New password must be different from current password"
}
{
"error": "Current password is incorrect"
}
This endpoint requires authentication. Include your JWT token in the request.
Request body
string
required
User’s current password
string
required
New password (minimum 8 characters)
Response
boolean
Indicates if the password change was successful
string
Success or error message
curl -X POST https://api-verifier-2.onrender.com/password-change \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token>" \
-d '{
"currentPassword": "oldpassword123",
"newPassword": "newpassword456"
}'
{
"success": true,
"message": "Password changed successfully"
}
{
"error": "New password must be different from current password"
}
{
"error": "Current password is incorrect"
}