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

Expose to auth_* whether they are being used for site or election

parent ab29fbab
......@@ -49,6 +49,7 @@ type logged_user = {
module type CONFIG = sig
include NAME
val kind : [ `Site | `Election of string ]
val auth_config : auth_config list
end
......@@ -159,6 +160,7 @@ module Make (N : CONFIG) = struct
let module N = struct
let name = instance
let path = N.path @ ["auth"; instance]
let kind = N.kind
end in
let module A = (val auth : AUTH_SERVICE) (N) (T) in
let i = (module A : AUTH_HANDLERS) in
......
......@@ -30,6 +30,7 @@ val register_auth_system : (module AUTH_SYSTEM) -> unit
module type CONFIG = sig
include NAME
val kind : [ `Site | `Election of string ]
val auth_config : auth_config list
end
......
......@@ -57,6 +57,7 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRATION = struct
module N = struct
let name = uuid
let path = base_path
let kind = `Election P.dir
let auth_config =
match P.metadata.e_auth_config with
......
......@@ -335,6 +335,7 @@ end
module type NAME = sig
val name : string
val path : string list
val kind : [ `Site | `Election of string ]
end
module type AUTH_SERVICE =
......
......@@ -55,6 +55,11 @@ module Make (C : CONFIG) : SITE = struct
open Eliom_service
open Eliom_registration
module C = struct
include C
let kind = `Site
end
let make_path x = C.path @ x
module Auth = Web_auth.Make (C)
......
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