package sihl

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Parameters

Signature

val find_all : Sihl_core.Ctx.t -> query:Sihl_database.Ql.t -> (Sihl_user__.Model.t list * Sihl_repository.Meta.t) Lwt.t
val find_opt : Sihl_core.Ctx.t -> user_id:string -> Sihl_user__.Model.t option Lwt.t
val find : Sihl_core.Ctx.t -> user_id:string -> Sihl_user__.Model.t Lwt.t
val find_by_email : Sihl_core.Ctx.t -> email:string -> Sihl_user__.Model.t Lwt.t
val find_by_email_opt : Sihl_core.Ctx.t -> email:string -> Sihl_user__.Model.t option Lwt.t
val update_password : Sihl_core.Ctx.t -> ?password_policy:(string -> (unit, string) Stdlib.Result.t) -> user:Sihl_user__.Model.t -> old_password:string -> new_password:string -> new_password_confirmation:string -> unit -> (Sihl_user__.Model.t, string) Stdlib.Result.t Lwt.t
val update_details : Sihl_core.Ctx.t -> user:Sihl_user__.Model.t -> email:string -> username:string option -> Sihl_user__.Model.t Lwt.t
val set_password : Sihl_core.Ctx.t -> ?password_policy:(string -> (unit, string) Stdlib.Result.t) -> user:Sihl_user__.Model.t -> password:string -> password_confirmation:string -> unit -> (Sihl_user__.Model.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 : Sihl_core.Ctx.t -> email:string -> password:string -> username:string option -> Sihl_user__.Model.t Lwt.t

Create and store a user.

val create_admin : Sihl_core.Ctx.t -> email:string -> password:string -> username:string option -> Sihl_user__.Model.t Lwt.t

Create and store a user that is also an admin.

val register_user : Sihl_core.Ctx.t -> ?password_policy:(string -> (unit, string) Stdlib.result) -> ?username:string -> email:string -> password:string -> password_confirmation:string -> unit -> (Sihl_user__.Model.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__.Model.t, string) Stdlib.Result.t Lwt.t

Find user by email if password matches.

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

Innovation. Community. Security.