mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Improve logging when failing to authenticate ssowat cookies
This commit is contained in:
parent
37b2db471b
commit
b28788d708
1 changed files with 12 additions and 4 deletions
16
helpers.lua
16
helpers.lua
|
@ -237,15 +237,23 @@ function refresh_logged_in()
|
|||
"|"..expireTime..
|
||||
"|"..session_key)
|
||||
is_logged_in = hash == authHash
|
||||
if not is_logged_in then
|
||||
logger.info("Hash "..authHash.." rejected for "..user.."@"..ngx.var.remote_addr)
|
||||
else
|
||||
if is_logged_in then
|
||||
authUser = user
|
||||
return true
|
||||
else
|
||||
failReason = "Hash not matching"
|
||||
end
|
||||
return is_logged_in
|
||||
else
|
||||
failReason = "No {user}-password entry in cache"
|
||||
end
|
||||
else
|
||||
failReason = "No session key"
|
||||
end
|
||||
else
|
||||
failReason = "Cookie expired"
|
||||
end
|
||||
logger.debug("SSOwat cookies rejected for "..user.."@"..ngx.var.remote_addr.." : "..failReason)
|
||||
return false
|
||||
end
|
||||
|
||||
-- If client set the `Proxy-Authorization` header before reaching the SSO,
|
||||
|
|
Loading…
Reference in a new issue