Repository navigation
feat(web): operations center, support tickets and two-factor sign-in (web 0.62.0) - #611
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Owner
Author
|
@coderabbitai review |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Action not completed
|
…(web 0.62.0) Staff (a staff table, rows added by hand) get Business without a subscription and a /ops area behind a session with two-factor sign-in: an overview of daily metrics, a ticket inbox with notes and saved replies, an account inspector that shows metadata only, a read-only view of an account opened from a ticket whose owner gave access (every look logged for the user), and held refund approvals. Signed-in users open tickets at /support on both sites, with screenshots, email on reply or close (on by default), reminders and auto-close, and an opt-in, revocable grant for support to view their account. Anyone can turn on an authenticator app under Account > Security; once on, aal1 sessions are refused by the API and by RLS. Migration 00087. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n-in The legacy verified_email agent flow (until its 2026-11-30 sunset) minted an API key for an existing account from an emailed code alone, which proves the inbox but not the authenticator. It now answers interaction_required for an account with a verified factor. Ticket pages also check the ticket number before it goes into an API path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nticators GoTrue's TOTP has no recovery codes, so the app keeps its own: ten one-time codes shown when two-factor sign-in is turned on (copy or download), stored as SHA-256 hashes in mfa_recovery_codes, replaceable under Account > Security. A code cannot raise a session to aal2, so using one on the sign-in screen removes the account's authenticators and the person sets two-factor up again. Staff can do the same from the account page in /ops for someone who proved who they are another way. The owner is emailed both times. Also asks for the authenticator code on /support, which signs in on its own: an account that still owed the code saw "Invalid session token". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ops account page hid the button for staff accounts, but the route only refused the caller's own id, so one staff session could strip another staff member's authenticator. It now refuses any staff account. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Staff actions (ops.*) are no longer mirrored into PostHog as product use. - Withdrawing access on a ticket ends that ticket's open views and logs view_ended, instead of every view of the account and only sometimes. - A staff answer on a closed ticket writes a "reopened" event. - Snooze stores a normalised timestamp, so odd date strings no longer 500. - A staff member without a name shows as "Support", never their email. - The plan page's staff notice needs the account to actually be staff. - The account menu asks whether you are staff when it first opens, not on every page load. - infra/supabase/gotrue-email-auth.md: TOTP runs on GoTrue's defaults (checked on production: no GOTRUE_MFA_* overrides, v2.197.0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kroqdotdev
force-pushed
the
t3/operations-center-support-tickets
branch
from
November 3, 2026 15:53
c7601a4 to
642345d
Compare
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.
What
An operations center for staff at
/ops, and support tickets for signed-in users at/supporton webhooks.cc and mailhooks.cc. Web 0.62.0, migration 00087.Staff
stafftable keyed by auth user id. Add rows by hand with psql, never in a migration.userskeeps a staff account on Business without a Polar subscription. A revoked subscription or the period job cannot move it off Business./opsand every/api/opsroute answer 404 to anyone who is not staff. They accept a browser session only, never an API key, and need two-factor sign-in (aal2).Operations center
ops_daily_metrics, which the web app fills hourly. Staff andusers.internalaccounts are left out.{{name}}/{{plan}}, snooze, spam, close.support_access_log.polar_refunds(00086, feat(web): refunds for charges that bought nothing (web 0.61.0) #609), with the orders and amounts the worker prepared.Support tickets (users)
SUPPORT_ALERT_EMAIL(default support@webhooks.cc) with no ticket contents.Two-factor sign-in for everyone
RequireAuthasks for the code, and every session-authenticated route refuses an aal1 session for that account.Fixes from a review pass before opening
storage_deletionsaccepts ticket prefixes. Without this, deleting an account whose ticket had screenshots failed.Other
/docs/support./ops.Deploy notes
00087_ops_support.sql(autocommit,lock_timeout), thenNOTIFY pgrst, 'reload schema'.public.staffwith psql.SUPPORT_ALERT_EMAIL. Object storage must be configured for screenshots (it already is in production).Tests
tests/integration/support-ops.test.tscovers the staff plan trigger, ticket lifecycle and notices, auto-close and reopen, grants, and the rollup. The billing suites still pass.🤖 Generated with Claude Code