diff --git a/functions/api/auth/session.ts b/functions/api/auth/session.ts index 071af9c..a2a64f6 100644 --- a/functions/api/auth/session.ts +++ b/functions/api/auth/session.ts @@ -112,10 +112,14 @@ export async function onRequestGet(context: RequestContext) { const memberData: { [k: string]: any } = await serverMemberReq.json(); if (serverMemberReq.ok) { - userData.permissions = await GetPermissions(userData.id, memberData.roles); + userData.permissions = await GetPermissions( + userData.id, + context, + memberData.roles, + ); userData.roles = memberData.roles; } else { - userData.permissions = await GetPermissions(userData.id); + userData.permissions = await GetPermissions(userData.id, context); } const selectedTokenStart = diff --git a/functions/permissions.ts b/functions/permissions.ts index 914f165..b4d1035 100644 --- a/functions/permissions.ts +++ b/functions/permissions.ts @@ -1,7 +1,7 @@ export default async function ( userid: string, + context: RequestContext, roles?: string[], - context?: RequestContext, ): Promise { let permissions = 0; @@ -14,7 +14,7 @@ export default async function ( ["165594923586945025", "289372404541554689", "396347223736057866"].includes( userid, ) || - Boolean(await context?.env.DATA.get(`gamemod_${userid}`)) + Boolean(await context.env.DATA.get(`gamemod_${userid}`)) ) permissions |= 1 << 5; if (