package sihl-user

  1. Overview
  2. Docs

Parameters

Signature

val find_user_in_session_opt : Sihl_type.Session.t -> Sihl_type.User.t option Lwt.t

Find currently logged in user in the current context.

Make sure to call authenticate_session before or apply the required session and authentication middlewares.

val find_user_in_session : Sihl_type.Session.t -> Sihl_type.User.t Lwt.t

Find currently logged in user in the current context.

Make sure to call authenticate_session before or apply the required session and authentication middlewares.

val authenticate_session : Sihl_type.User.t -> Sihl_type.Session.t -> unit Lwt.t

Assign a user to the current anonymous session.

Use authenticate_session ctx user to log in a user. If a user is already assigned to session, replace the user.

val unauthenticate_session : Sihl_type.Session.t -> unit Lwt.t

Log user out.

Remove user from current session so that session is anonymous again.

val register : unit -> Sihl_core.Container.Service.t
OCaml

Innovation. Community. Security.