Change user password
POST/company/users/changePass
Allows the authenticated user to change their own password.
Requirements:
- User must be authenticated (valid JWT)
- The new password must meet security requirements:
- Minimum 8 characters
- At least 1 uppercase letter
- At least 1 number
- Cannot be the same as the last 5 passwords
Flow:
- User sends current password and new password
- System verifies that the current password is correct
- If valid, updates to the new password
Request Example:
{
currentPassword: MiPassActual123,
newPassword: NuevaPassSegura456
}
Request
Responses
- 200
- 400
- 401
Password successfully changed
Invalid request. Possible causes:
- Missing fields in the request
- New password same as the current one
Unauthorized. Possible causes:
- Invalid or expired JWT token
- Incorrect current password
- New password does not meet requirements