fix mongodb templates and add migrate and generate scripts

This commit is contained in:
Aman Varshney
2025-05-02 22:17:51 +05:30
parent 437cf9a45a
commit 0cb24b1494
13 changed files with 765 additions and 443 deletions

View File

@@ -11,6 +11,7 @@ export const auth = betterAuth({
{{#if (eq database "postgres")}}provider: "postgresql"{{/if}}
{{#if (eq database "sqlite")}}provider: "sqlite"{{/if}}
{{#if (eq database "mysql")}}provider: "mysql"{{/if}}
{{#if (eq database "mongodb")}}provider: "mongodb"{{/if}}
}),
trustedOrigins: [
process.env.CORS_ORIGIN || "",{{#if (includes frontend "native")}}
@@ -67,7 +68,7 @@ import { expo } from "@better-auth/expo";
import { client } from "../db";
export const auth = betterAuth({
database: mongodbAdapter(client.db()),
database: mongodbAdapter(client),
trustedOrigins: [
process.env.CORS_ORIGIN || "",{{#if (includes frontend "native")}}
"my-better-t-app://",{{/if}}
@@ -104,4 +105,4 @@ export const auth = betterAuth({
plugins: [expo()]
{{/if~}}
});
{{/if}}
{{/if}}