Skip to content

fix(admin): correct identity register & change-password routes (405)#1310

Merged
iammukeshm merged 1 commit into
mainfrom
fix/admin-identity-register-route
Jun 24, 2026
Merged

fix(admin): correct identity register & change-password routes (405)#1310
iammukeshm merged 1 commit into
mainfrom
fix/admin-identity-register-route

Conversation

@iammukeshm

Copy link
Copy Markdown
Member

Problem

Adding a user from the admin app failed with 405 Method Not Allowed on POST /api/v1/identity/users/register (issue #1309).

The admin client posted to:

  • /api/v1/identity/users/register
  • /api/v1/identity/users/change-password

…but the API serves these as bare routes:

  • /api/v1/identity/register
  • /api/v1/identity/change-password

The /users prefix is only for user-collection sub-resources (/users, /users/{id}, /users/{id}/roles, …). register and change-password live directly under the identity group.

Why only admin was affected

  • The dashboard app already calls the correct bare routes (clients/dashboard/src/api/identity.ts).
  • The identity integration tests exercise /identity/register and /identity/change-password.
  • Only clients/admin/src/api/users.ts was wrong — and internally inconsistent: it already used the IDENTITY base (no /users) for forgot-password, reset-password, profile, and permissions, but used the /users BASE for these two calls.

Fix

Point registerUser and changePassword at the IDENTITY base, and update the route-mocked Playwright specs to match the real routes.

Verification

  • tsc -b clean.
  • All 13 admin user/security Playwright specs pass against a clean dev server (register POST, change-password POST, validation, error paths).

Fixes #1309

🤖 Generated with Claude Code

The admin app posted to /api/v1/identity/users/register and
/api/v1/identity/users/change-password, but the API serves these as
bare /api/v1/identity/register and /api/v1/identity/change-password
(the /users prefix is only for user-collection sub-resources). The
mismatch returned 405/404, so "Add new user" and "Change password"
failed in the admin UI.

The dashboard app already calls the correct bare routes, and the
identity integration tests exercise them — only admin's users.ts was
wrong, and it was internally inconsistent (it correctly used the
IDENTITY base for forgot-password/reset-password/profile but the
/users BASE for these two). Point both calls at the IDENTITY base and
update the route-mocked Playwright specs to match.

Fixes #1309

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@iammukeshm iammukeshm mentioned this pull request Jun 24, 2026
@iammukeshm iammukeshm merged commit 9d45014 into main Jun 24, 2026
16 checks passed
@iammukeshm iammukeshm deleted the fix/admin-identity-register-route branch June 24, 2026 11:37
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.

Add new user failed

1 participant