package sihl

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val lifecycle : Sihl__.Core_container.Lifecycle.t
val add_user : Sihl__.User_core.User.t -> Core.Ctx.t -> Core.Ctx.t
val require_user_opt : Core.Ctx.t -> Sihl__.User_core.User.t option
val require_user : Core.Ctx.t -> Sihl__.User_core.User.t
val find_all : Core.Ctx.t -> query:Data.Ql.t -> (Sihl__.User_core.User.t list * Data.Repo.Meta.t) Lwt.t
val find_opt : Core.Ctx.t -> user_id:string -> Sihl__.User_core.User.t option Lwt.t
val find : Core.Ctx.t -> user_id:string -> Sihl__.User_core.User.t Lwt.t
val find_by_email : Core.Ctx.t -> email:string -> Sihl__.User_core.User.t Lwt.t
val find_by_email_opt : Core.Ctx.t -> email:string -> Sihl__.User_core.User.t option Lwt.t
val update_password : Core.Ctx.t -> ?password_policy:(string -> (unit, string) Stdlib.Result.t) -> user:Sihl__.User_core.User.t -> old_password:string -> new_password:string -> new_password_confirmation:string -> unit -> (Sihl__.User_core.User.t, string) Stdlib.Result.t Lwt.t
val update_details : Core.Ctx.t -> user:Sihl__.User_core.User.t -> email:string -> username:string option -> Sihl__.User_core.User.t Lwt.t
val set_password : Core.Ctx.t -> ?password_policy:(string -> (unit, string) Stdlib.Result.t) -> user:Sihl__.User_core.User.t -> password:string -> password_confirmation:string -> unit -> (Sihl__.User_core.User.t, string) Stdlib.Result.t Lwt.t

Set the password of a user without knowing the old password.

This feature is typically used by admins.

val create_user : Core.Ctx.t -> email:string -> password:string -> username:string option -> Sihl__.User_core.User.t Lwt.t

Create and store a user.

val create_admin : Core.Ctx.t -> email:string -> password:string -> username:string option -> Sihl__.User_core.User.t Lwt.t

Create and store a user that is also an admin.

val register : Sihl__.Core_ctx.t -> ?password_policy:(string -> (unit, string) Stdlib.result) -> ?username:string -> email:string -> password:string -> password_confirmation:string -> unit -> (Sihl__.User_core.User.t, string) Stdlib.Result.t Lwt.t

Create and store new user.

Provide password_policy to check whether the password fulfills certain criteria.

val login : Sihl__.Core_ctx.t -> email:string -> password:string -> (Sihl__.User_core.User.t, string) Stdlib.Result.t Lwt.t

Find user by email if password matches.

OCaml

Innovation. Community. Security.