Added security key stuff
This commit is contained in:
parent
84f99fd35d
commit
26ca5a7093
8
bank.lua
8
bank.lua
|
@ -263,8 +263,12 @@ local function authProtect(func, secure)
|
||||||
) then
|
) then
|
||||||
return {success = false, error = "Invalid credentials"}
|
return {success = false, error = "Invalid credentials"}
|
||||||
end
|
end
|
||||||
if secure and (not msg.auth.key or msg.auth.key ~= SECURITY_KEY) then
|
if secure then
|
||||||
return {success = false, error = "Missing security key"}
|
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
|
end
|
||||||
return func(msg)
|
return func(msg)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue