Authentication
Quantum uses Auth.js (formerly NextAuth) for authentication.
Configuration
The main configuration is located at src/lib/auth.ts. We use a Drizzle adapter to store user sessions in your Postgres database.
import NextAuth from "next-auth"
import { DrizzleAdapter } from "@auth/drizzle-adapter"
import { db } from "@/lib/db"
export const { handlers, auth, signIn, signOut } = NextAuth({
adapter: DrizzleAdapter(db),
providers: [], // Add Google, GitHub here
})
Middleware
Protected routes are handled in middleware.ts. By default, the dashboard and API routes are protected.