Skip to content

feat: add admin endpoint to reset a user's password#76

Merged
boludo00 merged 1 commit intodevelopfrom
feature/admin-password-reset
Mar 3, 2026
Merged

feat: add admin endpoint to reset a user's password#76
boludo00 merged 1 commit intodevelopfrom
feature/admin-password-reset

Conversation

@boludo00
Copy link
Copy Markdown
Owner

@boludo00 boludo00 commented Mar 3, 2026

Summary

  • Adds PUT /api/users/{user_id}/password — admin-only endpoint to set a new password for any user
  • Applies the same validation as user creation (min 8 chars, max 72 bytes for bcrypt)
  • No knowledge of the current password required (admin override)

Test plan

  • Admin can reset another user's password and the user can then log in with the new password
  • Returns 404 for a non-existent user ID
  • Returns 400 for a password shorter than 8 characters
  • Returns 400 for a password longer than 72 bytes
  • Non-admin users receive 403 when hitting this endpoint

@boludo00 boludo00 merged commit 38281c3 into develop Mar 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant