aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/core
diff options
context:
space:
mode:
authormarzavec <admin@marzavec.com>2018-10-05 02:26:56 +0200
committerGitHub <noreply@github.com>2018-10-05 02:26:56 +0200
commit7718a367d7d7e7ac45092c602544cf8ce91a9cbf (patch)
treeca9ebbee3dff1c271695412b3e800d8f25b49b10 /server/src/commands/core
parentAdded hooks, modules and cleaned up code (diff)
parentMade admin pass stored as trip and handled by trip. Admin can now be an admin... (diff)
downloadhackchat-7718a367d7d7e7ac45092c602544cf8ce91a9cbf.tar.gz
hackchat-7718a367d7d7e7ac45092c602544cf8ce91a9cbf.zip
Merge pull request #38 from MinusGix/master
Admin pass stored as trip
Diffstat (limited to 'server/src/commands/core')
-rw-r--r--server/src/commands/core/join.js13
1 files changed, 6 insertions, 7 deletions
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);
}