From 26ca5a7093fbca5b404d2dc2eb477f47e8fac760 Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Tue, 29 Aug 2023 15:45:16 -0400 Subject: [PATCH] Added security key stuff --- bank.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bank.lua b/bank.lua index d9d29d6..5ed2391 100644 --- a/bank.lua +++ b/bank.lua @@ -263,8 +263,12 @@ local function authProtect(func, secure) ) then return {success = false, error = "Invalid credentials"} end - if secure and (not msg.auth.key or msg.auth.key ~= SECURITY_KEY) then - return {success = false, error = "Missing security key"} + if secure then + if not msg.auth.key then + return {success = false, error = "Missing security key"} + elseif msg.auth.key ~= SECURITY_KEY then + return {success = false, error = "Invalid security key"} + end end return func(msg) end