From e7724e24fd97015b58c89d23c4478a01b6851c9f Mon Sep 17 00:00:00 2001 From: MinusGix Date: Sun, 30 Sep 2018 14:41:28 -0500 Subject: Made admin pass stored as trip and handled by trip. Admin can now be an admin as long as they use the same password --- server/src/commands/core/join.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'server/src/commands') diff --git a/server/src/commands/core/join.js b/server/src/commands/core/join.js index 31bc3c1..21badaf 100644 --- a/server/src/commands/core/join.js +++ b/server/src/commands/core/join.js @@ -32,13 +32,12 @@ exports.parseNickname = (core, data) => { } let password = nickArray[1]; - if (userInfo.nick.toLowerCase() == core.config.adminName.toLowerCase()) { - if (password !== core.config.adminPass) { - return 'You are not the admin, liar!'; - } else { - userInfo.uType = 'admin'; - userInfo.trip = 'Admin'; - } + + if (hash(password + core.config.tripSalt) === core.config.adminTrip) { + userInfo.uType = 'admin'; + userInfo.trip = 'Admin'; + } else if (userInfo.nick.toLowerCase() == core.config.adminName.toLowerCase()) { // they've got the main-admin name while not being an admin + return 'You are not the admin, liar!'; } else if (password) { userInfo.trip = hash(password + core.config.tripSalt); } -- cgit v1.2.1