feat(auth): add basic Auth.js configuration

This commit is contained in:
ngc2207 2024-12-29 11:04:17 +08:00
parent b57323938b
commit a16f5a6e1d
4 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,7 @@
"clsx": "^2.1.1", "clsx": "^2.1.1",
"lucide-react": "^0.469.0", "lucide-react": "^0.469.0",
"next": "15.0.3", "next": "15.0.3",
"next-auth": "^5.0.0-beta.25",
"react": "19.0.0-rc-66855b96-20241106", "react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106", "react-dom": "19.0.0-rc-66855b96-20241106",
"tailwind-merge": "^2.6.0", "tailwind-merge": "^2.6.0",

View File

@ -0,0 +1,2 @@
import { handlers } from "@/auth";
export const { GET, POST } = handlers;

5
src/auth.ts Normal file
View File

@ -0,0 +1,5 @@
import NextAuth from "next-auth";
export const { handlers, signIn, signOut, auth } = NextAuth({
providers: [],
});

1
src/middleware.ts Normal file
View File

@ -0,0 +1 @@
export { auth as middleware } from "@/auth";