init
This commit is contained in:
commit
a04776256d
56 changed files with 6808 additions and 0 deletions
18
app/api/auth/[...nextauth]/route.ts
Normal file
18
app/api/auth/[...nextauth]/route.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import NextAuth, { NextAuthOptions } from "next-auth";
|
||||
import { PrismaAdapter } from "@next-auth/prisma-adapter";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import GoogleProvider from "next-auth/providers/google";
|
||||
|
||||
export const authOptions: NextAuthOptions = {
|
||||
adapter: PrismaAdapter(prisma),
|
||||
providers: [
|
||||
GoogleProvider({
|
||||
clientId: process.env.GOOGLE_CLIENT_ID as string,
|
||||
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
const handler = NextAuth(authOptions);
|
||||
|
||||
export { handler as GET, handler as POST };
|
||||
Loading…
Add table
Add a link
Reference in a new issue