Fix creation of kills to a different server exploit
This commit is contained in:
+3
-2
@@ -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)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user