mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Request headers bugfix
This commit is contained in:
parent
9038468a60
commit
d9814203c1
1 changed files with 10 additions and 10 deletions
18
access.lua
18
access.lua
|
@ -137,13 +137,13 @@ function set_headers (user)
|
|||
end
|
||||
end
|
||||
|
||||
ngx.header["Auth-User"] = user
|
||||
ngx.header["Remote-User"] = user
|
||||
ngx.header["Name"] = cache[user]["cn"]
|
||||
ngx.header["Email"] = cache[user]["mail"]
|
||||
ngx.header["Authorization"] = "Basic "..ngx.encode_base64(
|
||||
ngx.req.set_header("Auth-User", user)
|
||||
ngx.req.set_header("Remote-User", user)
|
||||
ngx.req.set_header("Name", cache[user]["cn"])
|
||||
ngx.req.set_header("Email", cache[user]["mail"])
|
||||
ngx.req.set_header("Authorization", "Basic "..ngx.encode_base64(
|
||||
cache[user]["uid"]..":"..cache[user]["password"]
|
||||
)
|
||||
))
|
||||
end
|
||||
|
||||
function display_login_form ()
|
||||
|
@ -164,7 +164,7 @@ function display_login_form ()
|
|||
and tokens[ngx.var.cookie_SSOwAuthToken]
|
||||
then
|
||||
-- Display normal form
|
||||
return pass
|
||||
return
|
||||
else
|
||||
-- Set token
|
||||
set_token_cookie()
|
||||
|
@ -202,12 +202,12 @@ end
|
|||
|
||||
function redirect (url)
|
||||
ngx.header["Set-Cookie"] = cookies
|
||||
return ngx.redirect(url, ngx.HTTP_MOVED_PERMANENTLY)
|
||||
return ngx.redirect(url)
|
||||
end
|
||||
|
||||
function pass ()
|
||||
delete_onetime_cookie()
|
||||
ngx.header["Set-Cookie"] = cookies
|
||||
ngx.req.set_header("Set-Cookie", cookies)
|
||||
return
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue