Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 5d2b4700 authored by Stephane Glondu's avatar Stephane Glondu

Unify logout services

parent d7aaa27d
......@@ -28,7 +28,7 @@ open Web_signatures
let home = service ~path:[""] ~get_params:unit ()
let admin = service ~path:["admin"] ~get_params:unit ()
let site_login = service ~path:["login"] ~get_params:(opt (string "service")) ()
let site_logout = service ~path:["logout"] ~get_params:unit ()
let logout = service ~path:["logout"] ~get_params:unit ()
let source_code = service ~path:["belenios.tar.gz"] ~get_params:unit ()
let get_randomness = service ~path:["get-randomness"] ~get_params:unit ()
......@@ -59,7 +59,6 @@ let election_setup_create = post_coservice ~csrf_safe:true ~fallback:election_se
let election_home = service ~path:["elections"] ~get_params:(suffix (uuid "uuid" ** suffix_const "")) ()
let election_admin = service ~path:["elections"] ~get_params:(suffix (uuid "uuid" ** suffix_const "admin")) ()
let election_login = service ~path:["elections"] ~get_params:(suffix_prod (uuid "uuid" ** suffix_const "login") (opt (string "service"))) ()
let election_logout = service ~path:["elections"] ~get_params:(suffix (uuid "uuid" ** suffix_const "logout")) ()
let election_set_featured = post_coservice ~fallback:election_admin ~post_params:(bool "featured") ()
let election_set_state = post_coservice ~fallback:election_admin ~post_params:(bool "state") ()
let election_update_credential = service ~path:["elections"] ~get_params:(suffix (uuid "uuid" ** suffix_const "update-cred")) ()
......
......@@ -259,11 +259,8 @@ let logout_handler () =
let () = Eliom_registration.Any.register ~service:site_login
(fun service () -> login_handler service None)
let () = Eliom_registration.Any.register ~service:site_logout
let () = Eliom_registration.Any.register ~service:logout
(fun () () -> logout_handler ())
let () = Eliom_registration.Any.register ~service:election_login
(fun ((uuid, ()), service) () -> login_handler service (Some uuid))
let () = Eliom_registration.Any.register ~service:election_logout
(fun (_, ()) () -> logout_handler ())
......@@ -77,7 +77,7 @@ let make_login_box style auth links =
module Site_links = struct
let login x = Eliom_service.preapply site_login x
let logout = Eliom_service.preapply site_logout ()
let logout = Eliom_service.preapply logout ()
end
module Site_auth = struct
......@@ -576,9 +576,7 @@ let election_login_box w =
election_login
((W.election.e_params.e_uuid, ()), x)
let logout =
Eliom_service.preapply
election_logout
(W.election.e_params.e_uuid, ())
Eliom_service.preapply logout ()
end in
let links = (module L : AUTH_LINKS) in
fun () -> make_login_box "" auth links
......@@ -993,10 +991,7 @@ let cast_confirmed w ~result () =
em [pcdata name];
] @ result);
p [
(let service =
Eliom_service.preapply
election_logout (params.e_uuid, ())
in
(let service = Eliom_service.preapply logout () in
a ~service [
pcdata "Log out and come back to election page"
] ());
......@@ -1095,7 +1090,7 @@ let already_logged_in () =
let content = [
div [
pcdata "You are already logged in as an administrator or on another election. You have to ";
a ~service:site_logout [pcdata "log out"] ();
a ~service:logout [pcdata "log out"] ();
pcdata " first."];
] in
let login_box = pcdata "" in
......
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