Skip to content

Manage billing and the password on the website - #167

Open
alpha5611331 wants to merge 1 commit into
mainfrom
feat/166-billing-on-web
Open

alpha5611331 wants to merge 1 commit into
mainfrom
feat/166-billing-on-web

Conversation

@alpha5611331

Copy link
Copy Markdown
Member

Closes #166

What

  • /payment keeps the current plan and the three pass cards (prices from GET /payment/subscription-plans). Choose, or Extend on the current pass, opens the website's checkout for that pass (/account/billing?plan=<plan>). Payment history in the header opens the website's billing page.
  • Removed: the in-app currency picker and payment creation, the History and Status tabs, and the change-password form, with their IPC channels (payment:get-currencies, payment:create, payment:get-status, payment:get-history, auth:change-password), API calls, types, payment-utils.ts, change-password.test.mjs and their copy in all nine locales.
  • Account page: the password form becomes a row with Change password (opens /account/security) and Open account.
  • webAccountService.open() (account:open-web): asks for a single-use 60-second code (POST /api/auth/handoff, PowerInterviewAI/backend#89) and opens WEBSITE_BASE_URL/<locale>/app-sign-in?next=<page>#code=<code>. The code is in the fragment; the session token never enters a URL. With no code (older backend, network) the page opens directly and the website asks the user to sign in.

The balance needs no refresh-on-focus: the health-check ping already updates it every 5 seconds.

Behaviour to know

Changing the password on the website signs out every other session, the app included, so the app returns to sign-in on its next ping, the same as any other device.

Tests

New test/web-account.test.mjs (12 checks): code in the fragment and never the query, page paths, the app-language prefix, a non-plan plan dropped, fallback without a code. pnpm lint, both tsc configs, pnpm build and pnpm test:main pass.

Release order

  1. Backend PowerInterviewAI/backend#91 deployed; confirm /api/auth/handoff and /api/auth/handoff/exchange in prod openapi.json.
  2. Website feat: user area with sign-in, billing and security marketing-website#31 deployed, with /account and /app-sign-in live.
  3. This release, as a minor bump. Older clients keep working: no endpoint they use is removed.

🤖 Generated with Claude Code

The app and the website's account area both had checkout, payment
history, payment status and a change-password form. Two copies drift
(they already showed different status labels), and every checkout change
was an admin, backend and client release, with macOS waiting on
notarization. The conventional split for a desktop app with a web
account is applied: the app keeps what using it needs (sign-in, plan
status, the low-balance and expiry warnings, the interview profile) and
links to the website for account management.

- /payment keeps the current plan and the pass cards with prices from
  the backend. Choose (or Extend, on the current pass) opens the
  website's checkout for that pass. Payment history is a link to it.
  The in-app currency picker, payment creation, history and status tabs
  are removed, with their IPC channels, API calls, types and copy.
- The account page's password form becomes a row that opens the
  website's security page, or the account overview.
- webAccountService.open() asks the backend for a single-use, 60-second
  handoff code and opens /app-sign-in with it in the URL fragment, in
  the app's language, so the user arrives signed in and the session
  token never enters a URL. Without a code the page opens anyway and
  the website asks the user to sign in.

The 5-second health-check ping already refreshes the balance, so a pass
bought in the browser shows without anything watching for it.

Closes #166

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Dec 5, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

This branch has not been deployed

No deployments
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.

Manage billing and password on the website instead of in the app

1 participant