package simple_httpd

  1. Overview
  2. Docs

Module Auth.MakeSource

Parameters

module Login : Login

Signature

Sourceval login_page : ?destination:string -> ?css:string -> ?page:Html.chaml -> Html.chaml

a basic default login page that you may associate to the given login_url. If will both validate login and display the given page if the user is not logged. The page can be adapted using the optional argument, either giving your own page or just the link of a css. In case of succesful login, the user is redirected to the destination (empty url = same page, by default)

Sourceval logout_page : ?destination:string -> ?page:Html.chaml -> Html.chaml

logout by destroying the login session data and cookies and send back to the destination login_url by default. If a page is provided, there is no redirection, the given page is directly displayed.

Sourceval check : ?nologin:(Response_code.t * Headers.t * string) -> ?check_data:(Login.t -> bool) -> 'a Request.t -> Cookies.t * Session.t

checking session, with proper type for defaut parameter of Server functions

Sourceval check_handler : ?not_logged:('a Request.t -> Response.t) -> ('a Request.t -> Cookies.t -> Login.t -> Response.t) -> 'a Request.t -> Response.t

A way to check the session and get the data associated to the session in the handler. One may also give a different response when not logged

Sourceval check_filter : ?nologin:(Response_code.t * Headers.t * string) -> ?check_data:(Login.t -> bool) -> 'a Filter.t

check session as a Filter

Sourceval get_session_data : 'a Request.t -> Login.t option
Sourceval auth_key : Login.t Session.key