Repository navigation
Google and passkey sign-in for returning users; stop duplicate embedded wallets - #7
Merged
Merged
Conversation
…ed wallets Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ded existing wallet Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This branch was successfully 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.
Summary
Faster sign-in for returning users. The sign-in page now has "Continue with Google" and "Sign in with a passkey" in addition to the email code. Both are login only:
initOAuth({ provider: "google", disableSignup: true }), and passkey sign-up stays off in the Privy dashboard.Why login only: in Privy, a Google login with an email that already has an email-code account creates a separate user, with a different embedded wallet and so a different payout account. That would split the account. Instead, a signed-in user turns these on from the bookings page (
QuickSignIncard:useLinkWithOAuth/useLinkWithPasskey), so they always attach to the same Privy user, bookings and payout account. If someone tries Google or a passkey before linking it, they see an error explaining that they need to sign in with an email code first and turn it on.loginMethods: ["email", "google", "passkey"].Duplicate embedded wallets. A brand-new email account got 4 Privy embedded wallets on its first sign-in. The likely cause is
RequireSession's fallbackcreateWallet()racing Privy'screateOnLoginand re-firing on every render. The fallback now:user.linkedAccountsalready lists a Privy wallet. If that wallet has no address after 15 s, the user sees an error with "Try again".Stable payout account.
requireUsernow keeps the wallet already stored inprofilesif the user still has it, instead of always taking the first Privy wallet in the list. If the profile read fails, the request returns a 503 instead of picking a wallet:Testing (local dev server against the real Privy app and Supabase, Playwright over CDP with a virtual WebAuthn authenticator)
Passed twice in a row, each time with a fresh email:
/app/new. The Privy API shows 1 embedded wallet (the earlier bug produced 4)./applinks it (Privy linked accounts:email, wallet, passkey)./app/newwith no code and the same single wallet, and the bookings page shows "Passkey sign-in is on".One earlier run timed out on step 4: the page stayed on sign-in after the passkey prompt. That run was before the review-fix commit, and the cause is unknown.
Not tested: completing Google sign-in or linking (needs a real Google account), and real device passkeys (only the virtual authenticator).
Link to Devin session: https://app.devin.ai/sessions/dc532fa9edf5401189dae9b7e6c5259c
Open in Devin Desktop: https://app.devin.ai/desktop/session/dc532fa9edf5401189dae9b7e6c5259c?variant=devin
Requested by: @CryptoZephyr