[HOTFIX] Auth Errors

This commit is contained in:
Dunemask 2024-03-29 12:05:23 -06:00
parent 2ba97fcb70
commit 40f020d27b

View file

@ -16,13 +16,11 @@ const getMclName = (host, id) =>
`${host.toLowerCase().replaceAll(".", "-")}-${id}`; `${host.toLowerCase().replaceAll(".", "-")}-${id}`;
export async function checkAuthorization(serverId, cairoId) { export async function checkAuthorization(serverId, cairoId) {
console.log(`Checking Authorization for user ${cairoId} for serverId ${serverId}`); if(!cairoId) return false;
const q = selectWhereAllQuery(table, { const q = selectWhereAllQuery(table, {
id: serverId, id: serverId,
owner_cairo_id: cairoId, owner_cairo_id: cairoId,
}); });
const queryRes = await pg.query(q);
console.log(`Server returned, ${JSON.stringify(queryRes)}`);
return (await pg.query(q)).length === 1; return (await pg.query(q)).length === 1;
} }