Add authentication to your app with social login, email/password, and session management. Scaffolds Auth.js with your chosen providers and database adapter.
Full-featured authentication with 80+ OAuth providers and database adapters
AUTH_SECRETProtect a route
Check authentication status in a server component
import { auth } from '@/lib/auth'
import { redirect } from 'next/navigation'
export default async function DashboardPage() {
const session = await auth()
if (!session) redirect('/login')
return <h1>Welcome, {session.user.name}</h1>
}Add authentication to your Primstack project with a single command:
prim auth init