From c857b938825f7e43171cdeec6c95da837fc79d0e Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 18 Oct 2025 02:45:50 +0000 Subject: [PATCH] Use crypto.randomUUID for invite tokens cgen-4022587eabf04783b1b81c5a831d7050 --- server/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/index.ts b/server/index.ts index 9072a435..fd9b7e32 100644 --- a/server/index.ts +++ b/server/index.ts @@ -3,6 +3,7 @@ import express from "express"; import cors from "cors"; import { adminSupabase } from "./supabase"; import { emailService } from "./email"; +import { randomUUID } from "crypto"; export function createServer() { const app = express(); @@ -678,8 +679,7 @@ export function createServer() { .json({ error: "inviter_id and invitee_email are required" }); } const email = safeEmail(invitee_email); - const token = (globalThis as any).crypto?.randomUUID?.() || - require("crypto").randomUUID(); + const token = randomUUID(); try { const { data: inviterProfile } = await adminSupabase .from("user_profiles")