mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Rename auth_key to srvkey
This commit is contained in:
parent
f51d64388e
commit
dec4ed143a
2 changed files with 3 additions and 3 deletions
|
@ -37,7 +37,7 @@ end
|
|||
function set_auth_cookie (user, domain)
|
||||
local maxAge = 60 * 60 * 24 * 7 -- 1 week
|
||||
local expire = ngx.req.start_time() + maxAge
|
||||
local hash = ngx.md5(auth_key..
|
||||
local hash = ngx.md5(srvkey..
|
||||
"|" ..ngx.var.remote_addr..
|
||||
"|"..user..
|
||||
"|"..expire)
|
||||
|
@ -99,7 +99,7 @@ function check_cookie ()
|
|||
-- Check expire time
|
||||
if (ngx.req.start_time() <= tonumber(ngx.var.cookie_SSOwAuthExpire)) then
|
||||
-- Check hash
|
||||
local hash = ngx.md5(auth_key..
|
||||
local hash = ngx.md5(srvkey..
|
||||
"|"..ngx.var.remote_addr..
|
||||
"|"..ngx.var.cookie_SSOwAuthUser..
|
||||
"|"..ngx.var.cookie_SSOwAuthExpire)
|
||||
|
|
2
init.lua
2
init.lua
|
@ -5,7 +5,7 @@ math = require "math"
|
|||
|
||||
-- Set random key
|
||||
math.randomseed(os.time())
|
||||
auth_key = math.random(1111111, 9999999)
|
||||
srvkey = math.random(1111111, 9999999)
|
||||
|
||||
-- Shared table
|
||||
tokens = {}
|
||||
|
|
Loading…
Reference in a new issue