Commit 4f69f0b2 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Improve messages in security log

parent a3d093b6
...@@ -110,6 +110,11 @@ module Make (C : CONFIG) (N : NAME) (T : TEMPLATES) : AUTH_HANDLERS = struct ...@@ -110,6 +110,11 @@ module Make (C : CONFIG) (N : NAME) (T : TEMPLATES) : AUTH_HANDLERS = struct
| None -> | None ->
match_lwt Eliom_reference.get logout_cont with match_lwt Eliom_reference.get logout_cont with
| None -> | None ->
lwt () = security_log (fun () ->
Printf.sprintf
"user is trying to log in, redirecting to CAS [%s]"
C.server
) in
Eliom_service.preapply cas_login self |> Eliom_service.preapply cas_login self |>
Eliom_registration.Redirection.send Eliom_registration.Redirection.send
| Some cont -> | Some cont ->
......
...@@ -91,11 +91,11 @@ module Make (N : CONFIG) = struct ...@@ -91,11 +91,11 @@ module Make (N : CONFIG) = struct
module Register (C : CONT_SERVICE) (T : TEMPLATES) : EMPTY = struct module Register (C : CONT_SERVICE) (T : TEMPLATES) : EMPTY = struct
let on_success user_domain user_handlers user_name () = let on_success user_domain user_handlers user_name () =
let user_user = {user_domain; user_name} in
security_log (fun () -> security_log (fun () ->
Printf.sprintf "%s successfully logged on %s using %s" Printf.sprintf "%s successfully logged into %s"
user_name N.name user_domain (string_of_user user_user) N.name
) >> ) >>
let user_user = {user_domain; user_name} in
let logged_user = {user_user; user_handlers} in let logged_user = {user_user; user_handlers} in
Eliom_reference.set user (Some logged_user) >> Eliom_reference.set user (Some logged_user) >>
C.cont () >>= Eliom_registration.Redirection.send C.cont () >>= Eliom_registration.Redirection.send
......
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