From 6f4df44a00181ba6e3c658f23bc7300a365b85e4 Mon Sep 17 00:00:00 2001 From: killer-cf Date: Fri, 7 Nov 2025 09:18:41 -0300 Subject: [PATCH] refactor: simplify auth component configuration - Removed the local schema configuration from the auth component, streamlining the integration with Better Auth. - Updated the client creation to focus solely on the DataModel, enhancing clarity and maintainability. --- packages/backend/convex/auth.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/backend/convex/auth.ts b/packages/backend/convex/auth.ts index 94ffdd1..32e54cc 100644 --- a/packages/backend/convex/auth.ts +++ b/packages/backend/convex/auth.ts @@ -4,20 +4,21 @@ import { components } from "./_generated/api"; import { type DataModel } from "./_generated/dataModel"; import { query } from "./_generated/server"; import { betterAuth } from "better-auth"; -import authSchema from "./betterAuth/schema"; +// import authSchema from "./betterAuth/schema"; const siteUrl = process.env.SITE_URL!; // The component client has methods needed for integrating Convex with Better Auth, // as well as helper methods for general use. -export const authComponent = createClient( - components.betterAuth, - { - local: { - schema: authSchema, - }, - } -); +export const authComponent = createClient(components.betterAuth); +// export const authComponent = createClient( +// components.betterAuth, +// { +// local: { +// schema: authSchema, +// }, +// } +// ); export const createAuth = ( ctx: GenericCtx,