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

AUTH_INSTANCE specifies a service handler rather than a service

parent 621149de
......@@ -116,6 +116,8 @@ module Make (C : CONFIG) (N : NAME) (S : CONT_SERVICE) (T : TEMPLATES) : AUTH_IN
Lwt.return (Eliom_service.preapply cas_login uri)
)
let handler () = Eliom_registration.Redirection.send service
end
type instance = {
......
......@@ -96,7 +96,7 @@ module Make (X : EMPTY) = struct
| _ -> failwith "several (or no) instances of auth systems"
)
let () = Eliom_registration.Redirection.register
let () = Eliom_registration.Any.register
~service:Services.login
(fun service () ->
lwt x = match service with
......@@ -106,7 +106,7 @@ module Make (X : EMPTY) = struct
try
let i = Hashtbl.find instances x in
let module A = (val i : AUTH_INSTANCE) in
Lwt.return A.service
A.handler ()
with Not_found -> fail_http 404
)
......
......@@ -53,6 +53,8 @@ module Make (N : NAME) (S : CONT_SERVICE) (T : TEMPLATES) : AUTH_INSTANCE = stru
in T.string_login ~service ~kind:`Dummy
)
let handler () = Eliom_registration.Redirection.send service
end
let init () =
......
......@@ -75,6 +75,8 @@ module Make (C : CONFIG) (N : NAME) (S : CONT_SERVICE) (T : TEMPLATES) : AUTH_IN
in T.password_login ~service
)
let handler () = Eliom_registration.Redirection.send service
end
type instance = {
......
......@@ -193,14 +193,11 @@ end
module type AUTH_INSTANCE = sig
val service :
(unit, unit,
[> `Attached of
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
Eliom_service.registrable, 'a)
Eliom_service.service
val handler :
unit ->
(Eliom_registration.browser_content,
Eliom_registration.http_service)
Eliom_registration.kind Lwt.t
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