[DEBUG] Minecluster Auth Errors

This commit is contained in:
Dunemask 2024-03-29 12:01:15 -06:00
parent 87e87f89d3
commit 2ba97fcb70

View file

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