Prompt
I'm building a product with social login and passwordless sign-in, how should I combine them?
Latest observation
A good rule is: treat social login and passwordless as two ways to prove the same account identity, not as separate accounts.
Recommended model
1) Have one “user” record
Store a single internal user ID, then attach login methods to it:
- email / phone
- Google / Apple / GitHub / etc.
- magic link / OTP / passkey
- password, if you still support it
Example conceptually:
usersauth_methodsuser_idtype=google,apple,magic_link,passkeyprovider_user_idor identifier- metadata
This prevents duplicate accounts when someone first signs in with Google, then later uses email OTP with the same email.
2) Use passwordless as the default fallback or primary path
For most consumer products, the smoothest setup is:
- Primary sign-in options
- Continue with Google
- Continue with Apple
- Continue with email link or OTP
- Optional:
- phone OTP
- passkeys
If you support both social and passwordless, let users choose either one at login, but once they’re in, offer account linking.
3) Link accounts by verified email carefully
When a user signs in with a social provider, you may get an email address. If you also support passwordless via email, you need a safe linking policy.
Safe approach
Only auto-link if:
- the email is verified by the provider
- and the email exactly matches an existing verified email on your system
- and your risk tolerance is acceptable
Safer approach
Instead of auto-linking silently:
- create or log into the existing account only after a confirmation step, or
- ask the user to prove control of the email/phone before merging
This is especially important because some providers may return emails that are not sufficiently trustworthy in all cases.
4) Don’t make passwordless depend on social login
They should be independent methods. If a social provider is unavailable or a user loses access to it, they should still be able to sign in via email OTP/magic link or passkey.
Best practice:
- allow users to add multiple sign-in methods
- encourage them to add at least one backup method
5) Best UX pattern
A simple login screen:
- Continue with Google
- Continue with Apple
- Email or phone
- Use passkey
After login, in account settings:
- Linked accounts
- Add email
- Add Apple/Google
- Add passkey
- Remove a method
- Set recovery options
6) Handle account creation consistently
Choose one of these policies:
Policy A: “Login creates account”
Any successful social or passwordless login creates a user account if none exists.
Pros:
- easy UX
- low friction
Cons:
- can create duplicates if linking is weak
Policy B: “Email-centric identity”
Email is the canonical identifier, and social/passwordless methods attach to it.
Pros:
- easier account merging
- simpler recovery
Cons:
- less flexible if you need phone-first flows or anonymous onboarding
For most products, email-centric + linked auth methods is the easiest to operate.
7) Important edge cases to plan for
- Same person signs in with Google and Apple using different relay emails
- User changes email at the provider
- User loses access to email but still has Google/Apple
- Social provider returns unverified or masked email
- User tries to create a new account with an email already used by another auth method
Have a clear policy for:
- merge
- block
- re-verify
- support-assisted recovery
Practical recommendation
If you’re starting from scratch, I’d suggest:
- Use a single user table
- Support:
- Apple
- email magic link or OTP
- passkeys if possible
- Let users link/unlink methods from account settings
- Avoid automatic merges unless the email is verified and you’re confident in the provider
- Make passwordless available even if a user originally signed up with social login
Simple decision guide
-
Need the easiest consumer UX?
- Social login + email magic link + passkeys
-
Need the strongest fallback/recovery?
- Social login + passwordless + passkeys + verified recovery email/phone
-
Need enterprise or high-security?
- Passkeys + SSO, with passwordless only as fallback if allowed
If you want, I can also sketch:
- a database schema,
- a sign-in/linking flow diagram,
- or a recommended policy for duplicate account prevention.