Merge pull request #140 from Aymendje/patch-1

Fix UNAUTHENTICATED mode
This commit is contained in:
Emrik Östling 2024-09-24 09:12:28 +02:00 committed by GitHub
commit e573997aa9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -456,7 +456,7 @@ const app = new Elysia({
} }
} }
} else if (ALLOW_UNAUTHENTICATED) { } else if (ALLOW_UNAUTHENTICATED) {
const newUserId = String(randomInt(2 ** 24, Number.MAX_SAFE_INTEGER)); const newUserId = String(randomInt(2 ** 24, Math.min(2 ** 48 + 2 ** 24 - 1, Number.MAX_SAFE_INTEGER)));
const accessToken = await jwt.sign({ const accessToken = await jwt.sign({
id: newUserId, id: newUserId,
}); });