Skip to content

Ensure client-secret reset submits as POST for non-admin client owners#964

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-reset-client-secret-issue
Open

Ensure client-secret reset submits as POST for non-admin client owners#964
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-reset-client-secret-issue

Conversation

Copilot AI commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Non-admin users could trigger “Reset client secret” from the UI, but the request path could degrade into a non-POST flow and hit a 405 Method Not Allowed on /clients/{id}/reset. As a result, secrets were not rotated and old credentials remained valid.

  • Reset form hardening (server-rendered template)

    • Updated the client details reset form to include explicit HTML form semantics (action + method="post") in addition to htmx attributes.
    • This preserves correct behavior for owner flows (/my-clients → client details) and guarantees the reset endpoint receives POST requests.
  • Coverage for non-admin owner flow

    • Added an e2e scenario for a regular user creating a personal client, resetting its secret, and asserting:
      • request method is POST to /clients/{uid}/reset
      • returned secret is newly rotated (different from prior secret)
<form
  th:data-hx-post="|/clients/${client.clientUid()}/reset|"
  th:action="|/clients/${client.clientUid()}/reset|"
  th:method="post"
  data-hx-target="body">
  <div th:replace="~{common/form-csrf}"></div>
  <button class="outline contrast" data-loading-disable>Reset client secret</button>
</form>

Copilot AI linked an issue Jun 6, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix reset client secret error for non-admin users Ensure client-secret reset submits as POST for non-admin client owners Jun 6, 2026
Copilot AI requested a review from Portals June 6, 2026 18:14
@Portals Portals marked this pull request as ready for review June 6, 2026 18: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.

Unable to reset client secret as non-admin user

2 participants