feat(auth): Facebook OAuth provider (#285) - #326
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds Facebook (Meta) as an OAuth sign-in provider: updates Changes
Sequence DiagramsequenceDiagram
participant User as User (Browser)
participant AuthUI as AuthScreen
participant NextAuth as NextAuth Server
participant Facebook as Facebook OAuth
participant DB as Database
User->>AuthUI: Click "Sign in with Facebook"
AuthUI->>NextAuth: signIn("facebook", { callbackUrl })
NextAuth->>Facebook: Redirect to Facebook login (auth request)
Facebook->>User: Display login / consent
User->>Facebook: Authenticate & consent
Facebook->>NextAuth: Redirect with code
NextAuth->>Facebook: Exchange code for token & email
NextAuth->>DB: signIn callback — verify/trust email, lookup or create/link account
DB-->>NextAuth: Return user record
NextAuth->>User: Redirect back to application (callbackUrl)
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📋 Issue PlannerLet us write the prompt for your AI agent so you can ship faster (with fewer bugs). View plan for ticket: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 59cab24. Configure here.
|
@CodeAnt-AI review |
|
Your free trial PR review limit of 100 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI. |
Extract buildOAuthCallbackUrl, shared button styles, and a reusable OAuthProviderSignInButton to address PR review duplication between Google and Facebook (Cursor Bugbot #326). Co-authored-by: Bretton Auerbach <auerbachb@users.noreply.github.com>
- Register Facebook in Auth.js with email scope; treat Facebook like
Google for email verification (Graph /me with email scope).
- Add Continue with Facebook on AuthScreen using signIn('facebook').
- Document AUTH_FACEBOOK_* in .env.example with privacy URL note.
- Link Meta Data Policy from privacy policy third-party sign-in section.
Co-authored-by: Bretton Auerbach <auerbachb@users.noreply.github.com>
Extract buildOAuthCallbackUrl, shared button styles, and a reusable OAuthProviderSignInButton to address PR review duplication between Google and Facebook (Cursor Bugbot #326). Co-authored-by: Bretton Auerbach <auerbachb@users.noreply.github.com>
08035c2 to
b58310b
Compare
|
Closing — Facebook OAuth deferred indefinitely. Hit a hard blocker at the Meta for Developers console: switching the app to Live mode requires Meta Business Verification, which demands business identity documents (IRS 147c, EIN, business bank statement, articles of incorporation, etc.) that Still Point doesn't have as a personal/hobby project. This PR's code is correct — the issue is purely operational on the Meta side. The branch Full context, decision options, and code-revival path: #341 |

Summary
Adds Auth.js built-in Facebook login alongside Google: provider registration in
auth-config.ts, Continue with Facebook onAuthScreen,.env.exampleforAUTH_FACEBOOK_ID/AUTH_FACEBOOK_SECRET, and a Meta Data Policy link on the privacy page.Facebook is treated like Google for the email-verification gate: the default Auth.js Facebook provider requests the
emailscope and Graph/mereturns the account email when granted (Facebook’s profile object does not exposeemail_verifiedthe way OIDC providers do).Manual / follow-up (not in repo)
.env.local(never commit).Closes #285.
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
Test plan
.env.local(dev):AUTH_FACEBOOK_ID,AUTH_FACEBOOK_SECRETAuthScreen.tsxwithprovider="facebook"— verified in codehttps://www.facebook.com/about/privacy/) — verified in codeconsole.log/access_token calls inauth-config.ts— verified in code