Fix creation of kills to a different server exploit

This commit is contained in:
2023-03-29 09:44:09 +02:00
parent 52e586f757
commit dd2375e427
+3 -2
View File
@@ -65,7 +65,7 @@ export async function CreateServer({
//tokens are stored in raw... maybe we should use something better in the future //tokens are stored in raw... maybe we should use something better in the future
//Using callback for express-basic-auth //Using callback for express-basic-auth
export function CheckServerToken( export function CheckServerToken(
this: { body: any }, this: { params: any, body: any },
name: string, name: string,
password: string, password: string,
cb: (error: Error | null, success: boolean) => void cb: (error: Error | null, success: boolean) => void
@@ -75,7 +75,8 @@ export function CheckServerToken(
.where('token', '=', password) .where('token', '=', password)
.executeTakeFirst() .executeTakeFirst()
.then((result) => { .then((result) => {
cb(null, !!result) if (name != this.params.serverId) return cb(null, false)
return cb(null, !!result)
}) })
} }
/* /*