mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
authUser is defined only if authHash is accepted
This commit is contained in:
parent
6a240e1dea
commit
397f7b3910
1 changed files with 3 additions and 2 deletions
|
@ -244,13 +244,14 @@ function refresh_logged_in()
|
||||||
if session_key and session_key ~= "" then
|
if session_key and session_key ~= "" then
|
||||||
-- Check cache
|
-- Check cache
|
||||||
if cache:get(user.."-password") then
|
if cache:get(user.."-password") then
|
||||||
authUser = user
|
|
||||||
local hash = hmac_sha512(srvkey,
|
local hash = hmac_sha512(srvkey,
|
||||||
authUser..
|
user..
|
||||||
"|"..expireTime..
|
"|"..expireTime..
|
||||||
"|"..session_key)
|
"|"..session_key)
|
||||||
if hash ~= authHash then
|
if hash ~= authHash then
|
||||||
logger.info("Hash "..authHash.." rejected for "..user.."@"..ngx.var.remote_addr)
|
logger.info("Hash "..authHash.." rejected for "..user.."@"..ngx.var.remote_addr)
|
||||||
|
else
|
||||||
|
authUser = user
|
||||||
end
|
end
|
||||||
is_logged_in = hash == authHash
|
is_logged_in = hash == authHash
|
||||||
return is_logged_in
|
return is_logged_in
|
||||||
|
|
Loading…
Reference in a new issue