Allows an authenticated user to change their password. Requires the current password for verification and enforces security requirements on the new password.
This action cannot be undone. Ensure users confirm their new password before submitting.
The API verifies the current password using bcrypt before allowing the change. This prevents unauthorized password changes if a token is compromised but the attacker doesn’t know the password.
Password Hashing
New passwords are hashed using bcrypt with 10 salt rounds before storage. Passwords are never stored in plain text.
Session Continuity
After changing the password, the current JWT token remains valid until expiration. The user does not need to log in again immediately.
Best Practices
Require password confirmation on the client side before submitting
Display password strength indicators to users
Consider implementing password history to prevent reuse