21 lines
572 B
TypeScript
21 lines
572 B
TypeScript
import { betterAuth } from "better-auth";
|
|
import { prismaAdapter } from "better-auth/adapters/prisma";
|
|
import { nextCookies } from "better-auth/next-js";
|
|
import prisma from "./lib/db";
|
|
|
|
export const auth = betterAuth({
|
|
database: prismaAdapter(prisma, {
|
|
provider: "postgresql"
|
|
}),
|
|
emailAndPassword: {
|
|
enabled: true
|
|
},
|
|
socialProviders: {
|
|
github: {
|
|
clientId: process.env.GITHUB_CLIENT_ID as string,
|
|
clientSecret: process.env.GITHUB_CLIENT_SECRET as string
|
|
},
|
|
},
|
|
plugins: [nextCookies()]
|
|
});
|