Set user ID to 0 if not using accounts

This commit is contained in:
Nick J authored and Emrik Östling committed 2025-07-24 18:03:55 +02:00
1 parent a9bc9d7e8d
commit 4c36a950a7
1 file changed
+1 -1
+1 -1
View File
@@ -33,7 +33,7 @@ export const root = new Elysia()
let user: ({ id: string } & JWTPayloadSpec) | false = false;
if (ALLOW_UNAUTHENTICATED) {
const newUserId = String(
randomInt(2 ** 24, Math.min(2 ** 48 + 2 ** 24 - 1, Number.MAX_SAFE_INTEGER)),
ACCOUNT_REGISTRATION ? randomInt(2 ** 24, Math.min(2 ** 48 + 2 ** 24 - 1, Number.MAX_SAFE_INTEGER)) : 0,
);
const accessToken = await jwt.sign({
id: newUserId,