Fix auth check for short links

This commit is contained in:
2024-11-01 15:03:11 -04:00
parent 3b86510e2a
commit abedaa8d20
3 changed files with 7 additions and 5 deletions

View File

@ -6,7 +6,9 @@ export async function onRequest(context: RequestContext) {
if (!user) return jsonError("Unauthorized", 401);
if (
![0, 2, 4, 5, 6, 7, 9, 10, 11, 12].find((i) => user.permissions & (1 << i))
typeof [0, 2, 4, 5, 6, 7, 9, 10, 11, 12].find(
(i) => user.permissions & (1 << i),
) === "undefined"
)
return jsonError("Forbidden", 403);