feat: add clerk auth support with convex (#548)

This commit is contained in:
Aman Varshney
2025-08-29 00:21:08 +05:30
committed by GitHub
parent 8d48ae0359
commit 54bcdf1cbc
153 changed files with 1954 additions and 771 deletions

View File

@@ -13,7 +13,7 @@ import { RPCHandler } from "@orpc/server/node";
import { CORSPlugin } from "@orpc/server/plugins";
import { appRouter } from "./routers/index";
import { createServer } from "node:http";
{{#if auth}}
{{#if (eq auth "better-auth")}}
import { createContext } from "./lib/context";
{{/if}}
{{/if}}
@@ -23,7 +23,7 @@ import { streamText, type UIMessage, convertToModelMessages } from "ai";
import { google } from "@ai-sdk/google";
{{/if}}
{{#if auth}}
{{#if (eq auth "better-auth")}}
import { auth } from "./lib/auth";
{{/if}}
@@ -77,7 +77,7 @@ const fastify = Fastify({
fastify.register(fastifyCors, baseCorsConfig);
{{#if auth}}
{{#if (eq auth "better-auth")}}
fastify.route({
method: ["GET", "POST"],
url: "/api/auth/*",
@@ -149,4 +149,4 @@ fastify.listen({ port: 3000 }, (err) => {
process.exit(1);
}
console.log("Server running on port 3000");
});
});