forked from zapashcanon/pellest
11 lines
321 B
OCaml
11 lines
321 B
OCaml
open Tyxml.Html
|
|
|
|
let csrf_tag request =
|
|
let open Tyxml.Html in
|
|
let token = Dream.csrf_token request in
|
|
input ~a:[ a_name "dream.csrf"; a_input_type `Hidden; a_value token ] ()
|
|
|
|
let make_form request ~action ~items =
|
|
(* TODO labels ...? *)
|
|
form ~a:[ a_action action; a_method `Post ] (csrf_tag request :: items)
|