mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Fix when the user stay connected
This commit is contained in:
parent
32d04dbac9
commit
437f3c238a
1 changed files with 9 additions and 0 deletions
|
@ -355,6 +355,15 @@ function set_headers(user)
|
|||
conf["ldap_identifier"].."=".. user ..","..conf["ldap_group"],
|
||||
cache:get(user.."-password")
|
||||
)
|
||||
-- If the ldap connection fail (because the password was changed).
|
||||
-- Logout the user and invalid the password
|
||||
if not ldap then
|
||||
ngx.log(ngx.NOTICE, "LDAP connection failled. Disconnect user : ".. user)
|
||||
cache:delete(authUser.."-password")
|
||||
flash("info", t("please_login"))
|
||||
local back_url = ngx.var.scheme .. "://" .. ngx.var.host .. ngx.var.uri .. uri_args_string()
|
||||
return redirect(conf.portal_url.."?r="..ngx.encode_base64(back_url))
|
||||
end
|
||||
ngx.log(ngx.NOTICE, "Reloading LDAP values for: "..user)
|
||||
for dn, attribs in ldap:search {
|
||||
base = conf["ldap_identifier"].."=".. user ..","..conf["ldap_group"],
|
||||
|
|
Loading…
Add table
Reference in a new issue