mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
Next.js 13.4 [is out](https://nextjs.org/blog/next-13-4). For discussing project-related issues, please use https://github.com/nextauthjs/next-auth/discussions/8487 The new version of NextAuth.js is based on `@auth/core`. If you want to test it out, you can do so already, installing `next-auth@experimental`: - **Documentation**: https://authjs.dev/reference/nextjs - **Migration guide**: https://authjs.dev/guides/upgrade-to-v5 BREAKING CHANGE: Follow the [migration guide](https://authjs.dev/guides/upgrade-to-v5)
20 lines
605 B
TypeScript
20 lines
605 B
TypeScript
import NextAuth from "next-auth"
|
|
import Email from "next-auth/providers/email"
|
|
import authConfig from "auth.config"
|
|
import { PrismaClient } from "@prisma/client"
|
|
import { PrismaAdapter } from "@auth/prisma-adapter"
|
|
|
|
globalThis.prisma ??= new PrismaClient()
|
|
|
|
// authConfig.providers.push(
|
|
// // Start server with `pnpm email`
|
|
// // @ts-expect-error
|
|
// Email({ server: "smtp://127.0.0.1:1025?tls.rejectUnauthorized=false" })
|
|
// )
|
|
|
|
export const { handlers, auth, signIn, signOut, update } = NextAuth({
|
|
// adapter: PrismaAdapter(globalThis.prisma),
|
|
session: { strategy: "jwt" },
|
|
...authConfig,
|
|
})
|