From 5542b4c83f62a46a2d2b7894bafd430303592159 Mon Sep 17 00:00:00 2001 From: Mathias Magnusson Date: Sat, 20 Jan 2024 21:04:32 +0100 Subject: [PATCH] Add banlist Closes #38 --- server/auth.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/auth.js b/server/auth.js index 9f29ff8..9b579d1 100644 --- a/server/auth.js +++ b/server/auth.js @@ -1,5 +1,6 @@ var Future = Npm.require('fibers/future') +var banlist = (process.env.BANLIST || "").split(",") Accounts.registerLoginHandler("kth", function(loginRequest) { var future = new Future @@ -16,6 +17,13 @@ Accounts.registerLoginHandler("kth", function(loginRequest) { }) var userId if(user) { + for (var i = 0; i < banlist.length; i++) { + if (banlist[i] == user.username) { + console.log("Denied log in of banned user", user.username) + future.return(undefined) + return + } + } future.return({ userId: user._id, token: loginRequest.token