Skip to content

feat(auth): prompt wallet-login users to buy YAPP right after signing in - #360

Merged
PastaPastaPasta merged 1 commit into
stagingfrom
feat/post-login-yapp-prompt
Sep 2, 2026
Merged

feat(auth): prompt wallet-login users to buy YAPP right after signing in#360
PastaPastaPasta merged 1 commit into
stagingfrom
feat/post-login-yapp-prompt

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

Why

A wallet (key-exchange) login leaves the browser with a HIGH auth key. It can post, but it cannot buy YAPP: a token purchase batch must be signed with a CRITICAL key, and only the wallet holds one. Until now a fresh wallet user's first post failed with an insufficient-YAPP error and bounced them into the Buy-YAPP modal, whose default path asks them to paste a CRITICAL private key into the browser. That is exactly what the wallet-login flow exists to avoid.

Combining the key-registration and purchase into one dash-st: scan is not possible: IdentityUpdate must be signed by MASTER, any batch containing a token transition collapses to CRITICAL, and each state transition carries one signature. So this PR makes the two steps back to back instead.

What

  • After a wallet login lands on a fully set-up account (intent.kind === 'ready') whose YAPP balance cannot cover a single post, the Buy-YAPP modal opens as the login modal closes.
  • It opens in a new 'wallet' signing mode: the confirmation screen offers Approve in wallet and goes straight to the dash-st: purchase QR from feat(token): buy YAPP via dash-st remote wallet signing #358, skipping local signing and the paste-a-key screen. Backing out of or timing out on the QR returns to the confirmation rather than the paste-key screen.
  • Accounts still needing a username or profile go through those steps first. A failed balance fetch is treated as unknown and skips the prompt rather than assuming zero.
  • loginWithKeyExchange now resolves with the post-login intent; useBuyYappModal.open takes an optional signing mode that resets to 'local' on close. Existing callers are unchanged.

Depends on

Wallet-side signing of the purchase QR is dashpay/dashwallet-ios#1109 (open), which builds against the platform feat/parse-state-transition branch. Dash Evo Tool can sign it today.

Validation

  • npm run lint clean (no warnings in touched files)
  • npm run build succeeds, static export produced
  • code-review-validator pass: no findings
  • Not exercised end to end against a wallet in this PR.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploying yappr-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: e71fc4f
Status: ✅  Deploy successful!
Preview URL: https://5fcd36ea.yappr-v2.pages.dev
Branch Preview URL: https://feat-post-login-yapp-prompt.yappr-v2.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 60d83ea1-e384-4d9d-9197-82326173cda3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploying yappr with  Cloudflare Pages  Cloudflare Pages

Latest commit: e71fc4f
Status: ✅  Deploy successful!
Preview URL: https://87df213a.yappr.pages.dev
Branch Preview URL: https://feat-post-login-yapp-prompt.yappr.pages.dev

View logs

A wallet (key-exchange) login leaves the browser with a HIGH auth key, which can post but cannot buy YAPP — only the wallet holds the CRITICAL key the purchase needs. Until now that meant a fresh wallet user hit an insufficient-YAPP error on their first post and was bounced through a purchase flow whose default path asks them to paste a CRITICAL private key into the browser.

Now, once a wallet login lands on a fully set-up account whose YAPP balance can't cover a single post, the Buy-YAPP modal opens as the login modal closes, in a new 'wallet' signing mode: the confirmation offers 'Approve in wallet' and goes straight to the dash-st: QR the same wallet can sign, skipping the paste-a-key screen entirely (also on QR back-out/timeout). Accounts still needing a username or profile go through those steps first, and a failed balance check skips the prompt rather than assuming zero.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@PastaPastaPasta
PastaPastaPasta force-pushed the feat/post-login-yapp-prompt branch from 9427122 to e71fc4f Compare September 2, 2026 15:04
@PastaPastaPasta
PastaPastaPasta merged commit 44eea84 into staging Sep 2, 2026
8 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the feat/post-login-yapp-prompt branch September 2, 2026 16:24
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.

1 participant