diff --git a/src/_staart/helpers/prisma.ts b/src/_staart/helpers/prisma.ts index 7a332aa46..912a3c875 100644 --- a/src/_staart/helpers/prisma.ts +++ b/src/_staart/helpers/prisma.ts @@ -14,11 +14,11 @@ prisma.$use(async (params, next) => { console.log("Secret it", config("twtSecret")); if (typeof result === "object" && !Array.isArray(result)) if (typeof result.id === "number") - result.id = sign(String(result.id), config("twtSecret")); + result.id = sign(String(result.id), config("twtSecret"), 10); if (Array.isArray(result)) result.map((result) => { if (typeof result.id === "number") - result.id = sign(String(result.id), config("twtSecret")); + result.id = sign(String(result.id), config("twtSecret"), 10); return result; }); return result; diff --git a/src/_staart/helpers/utils.ts b/src/_staart/helpers/utils.ts index c82afed00..30ba05c21 100644 --- a/src/_staart/helpers/utils.ts +++ b/src/_staart/helpers/utils.ts @@ -17,7 +17,7 @@ export type PartialBy = Omit & Partial>; export const twtToId = (twt: string, userId?: number) => twt === "me" && userId ? userId - : parseInt(verify(twt, config("twtSecret")), 10); + : parseInt(verify(twt, config("twtSecret"), 10), 10); /** * Delete any sensitive information for a user like passwords and tokens