Skip to content

feat: wallet login and improved onboarding#1589

Draft
joelorzet wants to merge 12 commits into
stagingfrom
feat/keep-171-improve-user-onboarding-experience
Draft

feat: wallet login and improved onboarding#1589
joelorzet wants to merge 12 commits into
stagingfrom
feat/keep-171-improve-user-onboarding-experience

Conversation

@joelorzet

Copy link
Copy Markdown

Summary

Reworks the sign-in entry point into a Connect modal and adds Sign-In With Ethereum (SIWE) wallet login alongside the existing email/social flow, plus a lightweight getting-started onboarding.

What changed

  • Connect modal replaces the bare "Sign In" button. Two panels: injected wallets on the left (discovered via EIP-6963, so MetaMask, Brave, Rabby, Coinbase, etc. each appear with their own icon), email + social sign-in on the right. The email panel keeps the existing OTP/password flow inline; an MFA step-up dialog layers over the modal for TOTP-enrolled users.
  • SIWE wallet login via Better Auth's first-party siwe plugin. Signature is verified offline with viem. The signature is treated as the auth factor: wallet sessions are minted MFA-satisfied and the proxy exempts wallet users from the TOTP enrollment/step-up gates. Wallet accounts get a generated human-readable handle (never a raw 0x address), and the non-deliverable synthetic-email OTP is suppressed.
  • Wallet rename modal on first wallet login: suggests two generated handles or a custom name, persists via /api/user/display-name, and flips users.display_name_confirmed so returning users aren't re-prompted. Keeps audit trails free of 0x addresses.
  • Getting-started overlay: collapsible steps (build a workflow, create an API key, connect an integration, set up the wallet) that auto-opens once per account and is reachable from the user menu.
  • DB: new wallet_address table and users.display_name_confirmed column, with the migration.

Notes

  • pnpm dev:https is included so the wallet flow can be exercised locally over a secure origin (wallets like Brave require https for SIWE). https://localhost is added to trusted origins for that.
  • Wallet brand icons under public/wallets/ are the wallets' official marks, used to identify each option in the connect list.
  • Unit/E2E coverage for the new flows is intentionally deferred; the pinned trusted-origins test will need updating for the two new entries.

joelorzet and others added 12 commits June 17, 2026 20:45
Adds the Drizzle table the Better Auth SIWE plugin needs and a
users.display_name_confirmed flag for the wallet rename step, with the
hand-authored migration and journal entry.
Registers Better Auth's SIWE plugin with offline viem signature
verification, assigns a generated handle instead of the 0x address,
suppresses the synthetic-email OTP, and stamps wallet sessions as
MFA-satisfied. Exempts wallet users from the MFA enrollment/step-up
gate in the proxy and trusts https://localhost for local secure-origin
testing. Adds the siwe client plugin and the handle generator.
Replaces the Sign In button with a Connect modal: EIP-6963 discovery
lists injected wallets and signs in via SIWE, while the right panel
keeps the existing email/OTP and social flow inline (with an MFA
step-up dialog layered over it). Installable wallet suggestions use
their official icons and hide once detected.
First-login rename step for wallet accounts: suggests two generated
handles (or a custom name) so audit trails never show a 0x address.
Persists via /api/user/display-name and flips display_name_confirmed.
Mounted globally and gated on that flag.
Adds a collapsible getting-started overlay (build a workflow, create an
API key, connect an integration, set up the wallet) that auto-opens
once per account and is reachable from the user menu. Wires the Connect
button in and treats wallet users as authenticated.
…llet sub-path

Replace the AGPL intro.js sign-in card with driver.js (MIT) and add an interactive workflow-editor walkthrough: build a Get Native Token Balance workflow, run it, and review the result. Adds a standalone Create Wallet sub-path that guides admins without a wallet before the balance step, dark/rounded popover theming, node centering + properties-tab focus on the configure step, and a fix that keeps Radix dropdowns interactive during a tour.

Includes dev seed + MFA/TOTP/email-OTP helper scripts, a tour-disable cookie fixture, and onboarding e2e tests; migrates the anonymous e2e suite onto the shared fixture.
…to feat/keep-171-improve-user-onboarding-experience

# Conflicts:
#	components/workflows/user-menu.tsx
#	drizzle/meta/_journal.json
Adds users.step_up_policy (wallet-only per-action factor config) and
users.step_up_email (verified step-up email), with migration 0117.
Adds the policy resolver and multi-factor requireStepUp orchestrator
(wallet signature + opted-in TOTP/email, reusing the existing encrypted
OTP, constant-time compare, TOTP and rate-limit primitives). Routes all
gated actions (withdraw, export-key, API-key create/revoke, TOTP
setup/disable/verify-stepup) through it, and adds the step-up policy and
verified-email enrollment endpoints (enabling a factor is free; removing
one requires passing step-up first).
Adds the client helper that signs a step-up challenge with the connected
wallet and retries, a wallet Security section (TOTP/email switches plus
per-action factor toggles and email enrollment), and makes the API-key
create/revoke overlays sign instead of prompting for codes. Hides the
password section for wallet accounts.
…ncation

Getting-started deep-links now push (so the overlay back button works),
completed steps show a green check, border and struck title from the
user's real workflows/keys/integrations/wallet, and the user menu shows
a truncated address for wallet accounts instead of the synthetic email.
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.

2 participants