Email + GitHub + Google OAuth with RBAC
The value is in the extras, not the setup: typed RBAC helpers (hasRole, requireRole, withAuth wrapper), full auth event audit log, password reset + email verification flows, and clean Supabase profile sync. The NextAuth config itself is a starting point — customise providers as needed.
next-authbcryptjs@supabase/supabase-jszod1export const authOptions: AuthOptions = {2 providers: [3 CredentialsProvider({ /* email + bcrypt */ }),4 GitHubProvider({ clientId, clientSecret }),5 GoogleProvider({ clientId, clientSecret }),6 ],7 callbacks: {8 async jwt({ token, user }) {9 if (user) {10 const { data } = await supabaseAdmin11 .from('profiles').select('id, role').eq('email', user.email!).single()12 token.id = data?.id13 token.role = data?.role ?? 'user'14 }15 return token16 },17 },18 session: { strategy: 'jwt', maxAge: 30 * 24 * 60 * 60 },19}Short excerpt. Full block includes SQL migrations, error handling, RLS policies, and complete file structure.
One-time · Instant GitHub access
✓Instant GitHub repo access
✓Own the code forever
✓Free updates
✓30-day refund if it breaks