diff --git a/src/actions.ts b/src/actions.ts index fc95a04..86c1722 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -63,7 +63,7 @@ function loadData(path: string | null) { const verify = ( { data, signature, algo, key }: { - data: string, signature: string, algo: string, key: string + data: string, signature: string, algo: string, key: string, } ) => { const verifier = crypto.createVerify(algo); @@ -74,7 +74,7 @@ const verify = ( } catch {} return success; -} +}; export let coil: Record = loadData(Config.coilpath); @@ -755,7 +755,7 @@ export const actions: { [k: string]: QueryHandler } = { success: id, expires: Date.now() + OAUTH_TOKEN_TIME, user: this.user.id, - }; + }; }, async 'oauth/api/refreshtoken'(params) { @@ -888,11 +888,6 @@ export const actions: { [k: string]: QueryHandler } = { )`WHERE teamid = ${teamid}`; const owns = data?.ownerid === this.user.id; if (!data || (owns ? false : (data.private && (password !== toID(data.private))))) { - if (!full) { - void fs.appendFile(`./config/teams.log`, JSON.stringify({ - teamid, user: this.user.id, date: Date.now(), - })); - } return { team: null }; } if ('views' in data && this.user.id !== data.ownerid) { @@ -970,7 +965,7 @@ export const actions: { [k: string]: QueryHandler } = { throw new ActionError(`You cannot delete that team, as it is not yours.`); } await tables.teams.deleteAll()`WHERE teamid = ${teamid}`; - return {success: true}; + return { success: true }; }, async copyteam(params) { let { teamid, password } = params; diff --git a/src/server.ts b/src/server.ts index 468205b..a1a391f 100644 --- a/src/server.ts +++ b/src/server.ts @@ -213,7 +213,7 @@ export class ActionContext { // account for shit like ::ffff:127.0.0.1 const num = IPTools.ipToNumber(ip) || 0; return ( - ip === '::ffff:127.0.0.1' || ip === '127.0.0.1' || + ip === '::ffff:127.0.0.1' || ip === '127.0.0.1' || Config.trustedproxies.some(f => IPTools.checkPattern(f, ip)) || IPTools.privateRelayIPs.some(f => f.minIP <= num && num <= f.maxIP) );