Added next auth api route

This commit is contained in:
r-freeman 2023-04-03 23:09:57 +01:00
parent 789e624905
commit 3772b12b14

View File

@ -0,0 +1,18 @@
import NextAuth from 'next-auth'
import GithubProvider from 'next-auth/providers/github'
import {PrismaAdapter} from '@next-auth/prisma-adapter'
import {PrismaClient} from '@prisma/client'
const GITHUB_CLIENT_ID = process.env.GITHUB_CLIENT_ID ?? ""
const GITHUB_SECRET = process.env.GITHUB_SECRET ?? ""
const prisma = new PrismaClient()
export default NextAuth({
adapter: PrismaAdapter(prisma),
providers: [
GithubProvider({
clientId: GITHUB_CLIENT_ID,
clientSecret: GITHUB_SECRET
})
],
})