mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-23 00:35:42 +00:00
Added next auth api route
This commit is contained in:
parent
789e624905
commit
3772b12b14
18
pages/api/auth/[...nextauth].ts
Normal file
18
pages/api/auth/[...nextauth].ts
Normal 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
|
||||||
|
})
|
||||||
|
],
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user