fix(admin): correct identity register & change-password routes (405)#1310
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-passwordThe
/usersprefix is only for user-collection sub-resources (/users,/users/{id},/users/{id}/roles, …).registerandchange-passwordlive directly under the identity group.Why only admin was affected
clients/dashboard/src/api/identity.ts)./identity/registerand/identity/change-password.clients/admin/src/api/users.tswas wrong — and internally inconsistent: it already used theIDENTITYbase (no/users) forforgot-password,reset-password,profile, andpermissions, but used the/usersBASEfor these two calls.Fix
Point
registerUserandchangePasswordat theIDENTITYbase, and update the route-mocked Playwright specs to match the real routes.Verification
tsc -bclean.Fixes #1309
🤖 Generated with Claude Code