Switch from SuperTokens to NextAuth.js
BREAKING CHANGE: Replace SuperTokens with NextAuth.js Why: - SuperTokens had persistent Traefik routing issues - SSL certificate not issuing correctly - Complex infrastructure (separate container) - NextAuth runs in Next.js app (simpler, no separate service) Changes: - Install next-auth, @auth/prisma-adapter, prisma - Create NextAuth API route: app/api/auth/[...nextauth]/route.ts - Add Prisma schema for NextAuth tables (users, sessions, accounts) - Update auth page to use NextAuth signIn() - Remove all SuperTokens code and dependencies - Keep same Google OAuth (just simpler integration) Benefits: - No separate auth service needed - No Traefik routing issues - Sessions stored in Montreal PostgreSQL - Simpler configuration - Battle-tested, widely used All authentication data stays in Montreal! Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { Toaster } from "@/components/ui/sonner";
|
||||
import { SuperTokensProvider } from "./components/SuperTokensProvider";
|
||||
import { SessionProvider } from "next-auth/react";
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
@@ -29,10 +29,10 @@ export default function RootLayout({
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
<SuperTokensProvider>
|
||||
<SessionProvider>
|
||||
{children}
|
||||
<Toaster />
|
||||
</SuperTokensProvider>
|
||||
</SessionProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user