feat: add mysql database

This commit is contained in:
Aman Varshney
2025-04-09 11:54:01 +05:30
parent 3cd9f31e01
commit c9b7e25e1d
25 changed files with 607 additions and 518 deletions

View File

@@ -0,0 +1,15 @@
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { db } from "../db";
import * as schema from "../db/schema/auth";
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "mysql",
schema: schema,
}),
trustedOrigins: [process.env.CORS_ORIGIN || ""],
emailAndPassword: {
enabled: true,
},
});

View File

@@ -8,10 +8,4 @@ export const auth = betterAuth({
}),
trustedOrigins: [process.env.CORS_ORIGIN || ""],
emailAndPassword: { enabled: true },
advanced: {
defaultCookieAttributes: {
sameSite: "none",
secure: true,
},
},
});

View File

@@ -0,0 +1,11 @@
import { betterAuth } from "better-auth";
import { prismaAdapter } from "better-auth/adapters/prisma";
import prisma from "../../prisma";
export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "mysql",
}),
trustedOrigins: [process.env.CORS_ORIGIN || ""],
emailAndPassword: { enabled: true },
});

View File

@@ -8,10 +8,4 @@ export const auth = betterAuth({
}),
trustedOrigins: [process.env.CORS_ORIGIN || ""],
emailAndPassword: { enabled: true },
advanced: {
defaultCookieAttributes: {
sameSite: "none",
secure: true,
},
},
});

View File

@@ -8,10 +8,4 @@ export const auth = betterAuth({
}),
trustedOrigins: [process.env.CORS_ORIGIN || ""],
emailAndPassword: { enabled: true },
advanced: {
defaultCookieAttributes: {
sameSite: "none",
secure: true,
},
},
});