// convex/auth.ts
export const authComponent = createClient<DataModel>(components.betterAuth);
export const createAuth = (ctx: GenericCtx<DataModel>, { optionsOnly } = { optionsOnly: false }) => {
return betterAuth({
baseURL: process.env.SITE_URL,
trustedOrigins: ["edgame://"],
database: authComponent.adapter(ctx),
emailAndPassword: { enabled: true, requireEmailVerification: false },
plugins: [expo(), convex()],
});
};
// convex/http.ts
authComponent.registerRoutes(http, createAuth);
// convex/auth.ts
export const authComponent = createClient<DataModel>(components.betterAuth);
export const createAuth = (ctx: GenericCtx<DataModel>, { optionsOnly } = { optionsOnly: false }) => {
return betterAuth({
baseURL: process.env.SITE_URL,
trustedOrigins: ["edgame://"],
database: authComponent.adapter(ctx),
emailAndPassword: { enabled: true, requireEmailVerification: false },
plugins: [expo(), convex()],
});
};
// convex/http.ts
authComponent.registerRoutes(http, createAuth);