package current_web

  1. Overview
  2. Docs

Module Current_web.ContextSource

Sourcetype t

The context of a single web request.

Sourceval of_request : site:Site.t -> Cohttp.Request.t -> t Lwt.t
Sourceval request : t -> Cohttp.Request.t
Sourceval csrf : t -> string

csrf t is the user's CSRF token to include in POST forms.

set_user t user records a successful login by user and redirects the user back to the page they came from.

respond_ok ctx content returns a successful page with content inserted into the site template.

Sourceval respond_redirect : t -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.t

respond_redirect ctx uri redirects the user to uri.

respond_error ctx code msg returns an error message to the user, inside the site template.

OCaml

Innovation. Community. Security.