Set user ID to 0 if not using accounts
This commit is contained in:
parent
a9bc9d7e8d
commit
4c36a950a7
1 changed files with 1 additions and 1 deletions
|
|
@ -33,7 +33,7 @@ export const root = new Elysia()
|
||||||
let user: ({ id: string } & JWTPayloadSpec) | false = false;
|
let user: ({ id: string } & JWTPayloadSpec) | false = false;
|
||||||
if (ALLOW_UNAUTHENTICATED) {
|
if (ALLOW_UNAUTHENTICATED) {
|
||||||
const newUserId = String(
|
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({
|
const accessToken = await jwt.sign({
|
||||||
id: newUserId,
|
id: newUserId,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue