mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Be consistent : either we use log() everywhere or we don't ... But imho just logger.info() is fine
This commit is contained in:
parent
7cb61f1619
commit
474b922089
1 changed files with 2 additions and 6 deletions
|
@ -12,10 +12,6 @@ local conf = config.get_config()
|
||||||
local logger = require("log")
|
local logger = require("log")
|
||||||
logger.outfile = "/var/log/nginx/ssowat.log"
|
logger.outfile = "/var/log/nginx/ssowat.log"
|
||||||
|
|
||||||
function log(...)
|
|
||||||
logger.info(...)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Read a FS stored file
|
-- Read a FS stored file
|
||||||
function read_file(file)
|
function read_file(file)
|
||||||
local f = io.open(file, "rb")
|
local f = io.open(file, "rb")
|
||||||
|
@ -164,7 +160,7 @@ function set_auth_cookie(user, domain)
|
||||||
"SSOwAuthHash="..hash..cookie_str,
|
"SSOwAuthHash="..hash..cookie_str,
|
||||||
"SSOwAuthExpire="..expire..cookie_str
|
"SSOwAuthExpire="..expire..cookie_str
|
||||||
}
|
}
|
||||||
log("Hash "..hash.." generated for "..user.."@"..ngx.var.remote_addr)
|
logger.info("Hash "..hash.." generated for "..user.."@"..ngx.var.remote_addr)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -228,7 +224,7 @@ function is_logged_in()
|
||||||
"|"..expireTime..
|
"|"..expireTime..
|
||||||
"|"..session_key)
|
"|"..session_key)
|
||||||
if hash ~= authHash then
|
if hash ~= authHash then
|
||||||
log("Hash "..authHash.." rejected for "..user.."@"..ngx.var.remote_addr)
|
logger.info("Hash "..authHash.." rejected for "..user.."@"..ngx.var.remote_addr)
|
||||||
end
|
end
|
||||||
return hash == authHash
|
return hash == authHash
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue