From dde085464cb094e2e01aab0b8322a83291164e53 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sun, 30 Mar 2025 22:21:01 +0200 Subject: [PATCH] fix(database): :bug: Remove some leftover parts of pg_uuidv7 --- utils/challenges.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/challenges.ts b/utils/challenges.ts index 6fab2f8f..919cd033 100644 --- a/utils/challenges.ts +++ b/utils/challenges.ts @@ -2,7 +2,7 @@ import { db } from "@versia/kit/db"; import { Challenges } from "@versia/kit/tables"; import { createChallenge } from "altcha-lib"; import type { Challenge } from "altcha-lib/types"; -import { sql } from "drizzle-orm"; +import { randomUUIDv7 } from "bun"; import { config } from "~/config.ts"; export const generateChallenge = async ( @@ -21,8 +21,7 @@ export const generateChallenge = async ( Date.now() + config.validation.challenges.expiration * 1000, ); - const uuid = (await db.execute(sql`SELECT uuid_generate_v7()`)) - .rows[0].uuid_generate_v7 as string; + const uuid = randomUUIDv7(); const challenge = await createChallenge({ hmacKey: config.validation.challenges.key,