mcp-context-forge icon indicating copy to clipboard operation
mcp-context-forge copied to clipboard

[BUG]: API Call - Users - Can not create/edit users with password_change_required:true

Open IuliaGaitan opened this issue 10 months ago • 2 comments

🐞 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

  1. Go to Swagger or use curl
  2. 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
}
  1. Check results on GET to http://localhost:8000/auth/email/admin/users

Results

The password_change_required is saved as false. Example: Image

Image

POST auth/email/admin/users/{user_email}

Image

🤔 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

IuliaGaitan avatar Jan 27 '26 13:01 IuliaGaitan

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).

crivetimihai avatar Jan 30 '26 12:01 crivetimihai

Same comment as #2524

IuliaGaitan avatar Feb 04 '26 13:02 IuliaGaitan