Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit b3ad3752 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Bugfix in Auth_cas: lazy computation of self URI

It matters behind a reverse-proxy.
parent 8ab43f18
...@@ -63,7 +63,7 @@ module Make (C : CONFIG) (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = stru ...@@ -63,7 +63,7 @@ module Make (C : CONFIG) (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = stru
let service = Eliom_service.preapply login_cas None let service = Eliom_service.preapply login_cas None
let self = let self =
Eliom_uri.make_string_uri ~absolute:true ~service () |> rewrite_prefix lazy (Eliom_uri.make_string_uri ~absolute:true ~service () |> rewrite_prefix)
let login_cont = Eliom_reference.eref ~scope None let login_cont = Eliom_reference.eref ~scope None
let logout_cont = Eliom_reference.eref ~scope None let logout_cont = Eliom_reference.eref ~scope None
...@@ -74,7 +74,7 @@ module Make (C : CONFIG) (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = stru ...@@ -74,7 +74,7 @@ module Make (C : CONFIG) (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = stru
match ticket with match ticket with
| Some x -> | Some x ->
let validation = let validation =
let service = Eliom_service.preapply cas_validate (self, x) in let service = Eliom_service.preapply cas_validate (Lazy.force self, x) in
Eliom_uri.make_string_uri ~absolute:true ~service () Eliom_uri.make_string_uri ~absolute:true ~service ()
in in
lwt reply = Ocsigen_http_client.get_url validation in lwt reply = Ocsigen_http_client.get_url validation in
...@@ -112,7 +112,7 @@ module Make (C : CONFIG) (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = stru ...@@ -112,7 +112,7 @@ module Make (C : CONFIG) (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = stru
"user is trying to log in, redirecting to CAS [%s]" "user is trying to log in, redirecting to CAS [%s]"
C.server C.server
) in ) in
Eliom_service.preapply cas_login (self, Some true) |> Eliom_service.preapply cas_login (Lazy.force self, Some true) |>
Eliom_registration.Redirection.send Eliom_registration.Redirection.send
| Some cont -> | Some cont ->
Eliom_reference.unset logout_cont >> Eliom_reference.unset logout_cont >>
...@@ -128,7 +128,7 @@ module Make (C : CONFIG) (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = stru ...@@ -128,7 +128,7 @@ module Make (C : CONFIG) (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = stru
Printf.sprintf "user logged out, redirecting to CAS [%s]" C.server Printf.sprintf "user logged out, redirecting to CAS [%s]" C.server
) >> ) >>
lwt () = Eliom_reference.set logout_cont (Some cont) in lwt () = Eliom_reference.set logout_cont (Some cont) in
Eliom_service.preapply cas_logout self |> Eliom_service.preapply cas_logout (Lazy.force self) |>
Eliom_registration.Redirection.send Eliom_registration.Redirection.send
end end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment