[BUG]: API Call - Users - Can not create/edit users with password_change_required:true
🐞 Bug Summary
Tested on local environment. Using POST http://localhost:8000/auth/email/admin/users with password_change_required:true in body is saving the user password_change_required value false. Same issue with trying to update the user using POST auth/email/admin/users/{user_email}
🧩 Affected Component
Select the area of the project impacted:
- [x]
mcpgateway- API - [ ]
mcpgateway- UI (admin panel) - [ ]
mcpgateway.wrapper- stdio wrapper - [ ] Federation or Transports
- [ ] CLI, Makefiles, or shell scripts
- [ ] Container setup (Docker/Podman/Compose)
- [ ] Other (explain below)
🔁 Steps to Reproduce
- Go to Swagger or use curl
- Make a POST to http://localhost:8000/auth/email/admin/users payload
{
"email": "[email protected]",
"password": "TempPass123!",
"full_name": "[email protected]",
"is_admin": false,
"is_active": true,
"password_change_required" : true
}
- Check results on GET to http://localhost:8000/auth/email/admin/users
Results
The password_change_required is saved as false.
Example:
POST auth/email/admin/users/{user_email}
🤔 Expected Behavior
The password_change_required should be saved as true and the user forced to change the password as it is in the UI.
📓 Logs / Error Output
Paste any relevant stack traces or logs here. ⚠️ Do not paste secrets, credentials, or tokens.
🧠 Environment Info
You can retrieve most of this from the /version endpoint.
| Key | Value |
|---|---|
| Version or commit | v0.128.0 |
| Runtime | Python 3.12.3 |
| Platform / OS | Linux 6.6.87.2-microsoft-standard-WSL2 (x86_64) |
| Container | none |
🧩 Additional Context (optional)
Related to #2390
Thank you for the report.
Confirmed: The EmailRegistrationRequest schema doesn't include password_change_required field. Values passed are silently ignored by Pydantic.
Fix: Add password_change_required: bool = Field(False) to EmailRegistrationRequest schema and wire it through the create_user endpoint.
Related to #2524 (same root cause - missing is_active field).
Same comment as #2524