first commit
This commit is contained in:
commit
6857e301fa
23 files changed
+5500
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { NextApiHandler } from "next";
|
||||
import NextAuth from "next-auth";
|
||||
import Providers from "next-auth/providers";
|
||||
import { PrismaAdapter } from '@next-auth/prisma-adapter'
|
||||
import GitHubProvider from 'next-auth/providers/github'
|
||||
import EmailProvider from 'next-auth/providers/email'
|
||||
import prisma from '../../../lib/prisma'
|
||||
|
||||
|
||||
const authHandler: NextApiHandler = (req, res) => NextAuth(req, res, options);
|
||||
export default authHandler;
|
||||
|
||||
const options = {
|
||||
providers: [
|
||||
GitHubProvider({
|
||||
clientId: process.env.GITHUB_ID,
|
||||
clientSecret: process.env.GITHUB_SECRET,
|
||||
}),
|
||||
EmailProvider({
|
||||
server: {
|
||||
host: process.env.SMTP_HOST,
|
||||
port: Number(process.env.SMTP_PORT),
|
||||
auth: {
|
||||
user: process.env.SMTP_USER,
|
||||
pass: process.env.SMTP_PASSWORD,
|
||||
},
|
||||
},
|
||||
from: process.env.SMTP_FROM,
|
||||
}),
|
||||
],
|
||||
adapter: PrismaAdapter(prisma),
|
||||
secret: process.env.SECRET,
|
||||
};
|
||||
Reference in new issue
Block a user