Sync deployment and project page fixes

This commit is contained in:
willchen96 2026-05-13 02:32:26 +08:00
parent 91d0c2a089
commit f39f175273
13 changed files with 1444 additions and 1315 deletions

View file

@ -1,16 +1,7 @@
import { Router } from "express";
import { createClient } from "@supabase/supabase-js";
import { requireAuth } from "../middleware/auth";
import { createServerSupabase } from "../lib/supabase";
function getAdminClient() {
return createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL ?? "",
process.env.SUPABASE_SECRET_KEY ?? "",
{ auth: { autoRefreshToken: false, persistSession: false } },
);
}
export const workflowsRouter = Router();
type Db = ReturnType<typeof createServerSupabase>;
@ -113,7 +104,7 @@ workflowsRouter.get("/", requireAuth, async (req, res) => {
: { data: [] };
// Fetch sharer emails via admin client
const admin = getAdminClient();
const admin = createServerSupabase();
const { data: authData } = await admin.auth.admin.listUsers({ perPage: 1000 });
const authUsers = authData?.users ?? [];