fix(database): 🐛 Remove some leftover parts of pg_uuidv7

This commit is contained in:
Jesse Wierzbinski 2025-03-30 22:21:01 +02:00
parent 9d79543951
commit dde085464c
No known key found for this signature in database

View file

@ -2,7 +2,7 @@ import { db } from "@versia/kit/db";
import { Challenges } from "@versia/kit/tables"; import { Challenges } from "@versia/kit/tables";
import { createChallenge } from "altcha-lib"; import { createChallenge } from "altcha-lib";
import type { Challenge } from "altcha-lib/types"; import type { Challenge } from "altcha-lib/types";
import { sql } from "drizzle-orm"; import { randomUUIDv7 } from "bun";
import { config } from "~/config.ts"; import { config } from "~/config.ts";
export const generateChallenge = async ( export const generateChallenge = async (
@ -21,8 +21,7 @@ export const generateChallenge = async (
Date.now() + config.validation.challenges.expiration * 1000, Date.now() + config.validation.challenges.expiration * 1000,
); );
const uuid = (await db.execute(sql<string>`SELECT uuid_generate_v7()`)) const uuid = randomUUIDv7();
.rows[0].uuid_generate_v7 as string;
const challenge = await createChallenge({ const challenge = await createChallenge({
hmacKey: config.validation.challenges.key, hmacKey: config.validation.challenges.key,