feat: wallet login and improved onboarding#1589
Draft
joelorzet wants to merge 12 commits into
Draft
Conversation
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.
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.
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
siweplugin. 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 raw0xaddress), and the non-deliverable synthetic-email OTP is suppressed./api/user/display-name, and flipsusers.display_name_confirmedso returning users aren't re-prompted. Keeps audit trails free of0xaddresses.wallet_addresstable andusers.display_name_confirmedcolumn, with the migration.Notes
pnpm dev:httpsis included so the wallet flow can be exercised locally over a secure origin (wallets like Brave require https for SIWE).https://localhostis added to trusted origins for that.public/wallets/are the wallets' official marks, used to identify each option in the connect list.