[HOTFIX] Auth Errors
This commit is contained in:
parent
2ba97fcb70
commit
40f020d27b
1 changed files with 1 additions and 3 deletions
|
@ -16,13 +16,11 @@ const getMclName = (host, id) =>
|
|||
`${host.toLowerCase().replaceAll(".", "-")}-${id}`;
|
||||
|
||||
export async function checkAuthorization(serverId, cairoId) {
|
||||
console.log(`Checking Authorization for user ${cairoId} for serverId ${serverId}`);
|
||||
if(!cairoId) return false;
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue