Skip to content

Let agents reset a ticket's customer portal link - #57

Merged
royalpriest merged 1 commit into
mainfrom
feat/reset-portal-link
Nov 21, 2026
Merged

royalpriest merged 1 commit into
mainfrom
feat/reset-portal-link

Conversation

@royalpriest

@royalpriest royalpriest commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Closes #20

What changed

  • New "Reset customer link" button on the agent ticket page, under "Copy customer portal link". It asks for confirmation, then calls ticket.regenerate_portal_token.
  • The old /portal/tickets/:token link returns 404 straight away. Reply and rating emails build the link from the current token, so the customer's next email carries the new one.
  • Route: PATCH /tickets/:ticket_id/portal_link, handled by a small PortalLinksController. Signed-out visitors are sent to sign in, like every other agent page.
  • Also bumps Brakeman to 8.1.1 so scan_ruby passes. It's the same one-line lockfile change as Limit CI token to read-only and fix the scan_ruby check #56, so whichever merges first, the other still merges cleanly.

Checks

  • bin/rails test: 140 runs, 0 failures (4 new tests, including "old token returns 404 after a reset")
  • bin/rails test:system: 8 runs, 0 failures
  • bin/rubocop: no offenses
  • bin/brakeman --no-pager: no warnings

Add a "Reset customer link" button under the copy link button on the
ticket page. It regenerates the ticket's portal token, so the old link
returns 404 and the next email to the customer carries the new one.

Also update Brakeman to 8.1.1 so the scan_ruby check passes (same change
as the workflow permissions PR).

Closes #20
@royalpriest royalpriest self-assigned this Nov 21, 2026
@royalpriest
royalpriest merged commit 04468db into main Nov 21, 2026
10 checks passed
@royalpriest
royalpriest deleted the feat/reset-portal-link branch November 21, 2026 00:26
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.

Let customer portal links be revoked

1 participant