Repository navigation
Manage billing and the password on the website - #167
Open
alpha5611331 wants to merge 1 commit into
Open
alpha5611331 wants to merge 1 commit into
alpha5611331 wants to merge 1 commit into
Conversation
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>
6 tasks
This branch has not been deployed
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.
Closes #166
What
/paymentkeeps the current plan and the three pass cards (prices fromGET /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.payment:get-currencies,payment:create,payment:get-status,payment:get-history,auth:change-password), API calls, types,payment-utils.ts,change-password.test.mjsand their copy in all nine locales./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 opensWEBSITE_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-planplandropped, fallback without a code.pnpm lint, bothtscconfigs,pnpm buildandpnpm test:mainpass.Release order
/api/auth/handoffand/api/auth/handoff/exchangein prodopenapi.json./accountand/app-sign-inlive.minorbump. Older clients keep working: no endpoint they use is removed.🤖 Generated with Claude Code