Skip to content

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

In review

Description

@alpha5611331

Why

The app and the website's account area both implement checkout, payment history, payment status and password change. Two implementations of the same thing drift (they already show different status labels and layouts), double the testing, and make every pricing or checkout change a coordinated admin, backend and client release, with macOS waiting on notarization.

The conventional split for a desktop app with a web account (Slack, Zoom, Notion, 1Password, JetBrains) is:

  • In the app: what is needed while using it. Sign in and out, plan status and free time left, the low-balance and expiry warnings, and the interview profile (full_name, CV, job context).
  • On the website: account management. Checkout, payment history and receipts, password, and later email change and account deletion.

What changes

Payment page becomes a plan page (/payment route kept, so every existing "Subscribe" entry point still works)

  • Keep the current-plan summary and the three pass cards with their prices from GET /payment/subscription-plans, so the user still compares plans without leaving the app.
  • "Buy" on a card opens the website's checkout for that pass in the browser: /account/billing?plan=<plan>, which opens the checkout dialog straight away.
  • Remove the in-app currency picker, payment creation, the History tab and the Status tab. "Payment history" becomes a link to /account/billing. A payment that was in progress in the app before the update is offered for resuming on the website's billing page, so nothing is stranded.
  • When the window regains focus, refresh the balance, so a pass bought in the browser shows as soon as the user comes back.

Account page

  • Replace the change-password form with a "Change password" row that opens /account/security.
  • Rename the "Full name" field to make clear it is the name used in interview answers, which is a different field from the account name shown on the website.

Signed in on arrival

Every link to the account area goes through one main-process helper:

  1. POST /api/auth/handoff for a single-use 60-second code (https://github.com/PowerInterviewAI/backend/issues/89).
  2. Open https://www.powerinterviewai.com/<locale>/app-sign-in?next=<path>#code=<code> with shell.openExternal (through the existing openExternally scheme guard).
  3. If the code request fails (older backend, network), open the plain page instead; the website asks the user to sign in and continues to the same place.

The website URL is a constant next to API_BASE_URL, with the same dev override pattern.

Rollout

Backend handoff endpoints deployed and visible in prod openapi.json, then the website with /account and /app-sign-in live, then this client release (a minor bump). Older clients keep working throughout: no backend endpoint they use is removed.

Acceptance

  • Buying a pass from the app opens the website's checkout for that pass, signed in
  • History, status, currency and payment-creation code removed from the renderer, the IPC layer and the main-process API where nothing else uses it
  • Password change opens the website
  • Balance refreshes on window focus
  • All nine locales updated
  • pnpm lint, both tsc configs, pnpm build, pnpm test:main pass

Website side: PowerInterviewAI/marketing-website#32, PowerInterviewAI/marketing-website#33

Activity

  1. alpha5611331 commented on Dec 5, 2026

    @alpha5611331
    MemberAuthor

    Done in #167, with two deviations:

    • No refresh-on-focus. The health-check ping already refreshes the balance every 5 seconds while signed in.
    • The app's "Full name" label is unchanged. Its placeholder already says "The name you go by in the interview", and the website's field is now labelled "Account name" (marketing-website#33), which separates the two.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions