浏览代码

Merge pull request #140 from Aymendje/patch-1

Fix UNAUTHENTICATED mode
Emrik Östling 10 月之前
父节点
当前提交
e573997aa9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/index.tsx

+ 1 - 1
src/index.tsx

@@ -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,
       });
       });