From fb45cd0441c21d3f79628ec579183a68fd8afa82 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 18 Jun 2020 14:48:14 +0200 Subject: [PATCH] do not compare the same thing several times --- helpers.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers.lua b/helpers.lua index 8d9fada..6736d3a 100644 --- a/helpers.lua +++ b/helpers.lua @@ -248,12 +248,12 @@ function refresh_logged_in() user.. "|"..expireTime.. "|"..session_key) - if hash ~= authHash then + is_logged_in = hash == authHash + if not is_logged_in then logger.info("Hash "..authHash.." rejected for "..user.."@"..ngx.var.remote_addr) else authUser = user end - is_logged_in = hash == authHash return is_logged_in end end