package sihl-user

  1. Overview
  2. Docs

Module Sihl_user.MakeSource

Parameters

module Repo : sig ... end

Signature

Sourceval find_opt : user_id:string -> Sihl__.Contract_user.t option Lwt.t
Sourceval find : user_id:string -> Sihl__.Contract_user.t Lwt.t
Sourceval find_by_email : email:string -> Sihl__.Contract_user.t Lwt.t

find_by_email email returns a User.t if there is a user with email address email. Raises an {!Exception} otherwise.

Sourceval find_by_email_opt : email:string -> Sihl__.Contract_user.t option Lwt.t

find_by_email_opt email returns a User.t if there is a user with email address email.

Sourceval update_password : ?password_policy:(string -> (unit, string) Result.t) -> user:Sihl__.Contract_user.t -> old_password:string -> new_password:string -> new_password_confirmation:string -> unit -> (Sihl__.Contract_user.t, string) Result.t Lwt.t
Sourceval update_details : user:Sihl__.Contract_user.t -> email:string -> username:string option -> Sihl__.Contract_user.t Lwt.t
Sourceval set_password : ?password_policy:(string -> (unit, string) Result.t) -> user:Sihl__.Contract_user.t -> password:string -> password_confirmation:string -> unit -> (Sihl__.Contract_user.t, string) Result.t Lwt.t

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

This feature is typically used by admins.

Sourceval create : email:string -> password:string -> username:string option -> admin:bool -> confirmed:bool -> (Sihl__.Contract_user.t, string) result Lwt.t
Sourceval create_user : email:string -> password:string -> username:string option -> Sihl__.Contract_user.t Lwt.t

Create and store a user.

Sourceval create_admin : email:string -> password:string -> username:string option -> Sihl__.Contract_user.t Lwt.t

Create and store a user that is also an admin.

Sourceval register_user : ?password_policy:(string -> (unit, string) result) -> ?username:string -> email:string -> password:string -> password_confirmation:string -> unit -> (Sihl__.Contract_user.t, Sihl__.Contract_user.error) Result.t Lwt.t

Create and store new user.

Provide password_policy to check whether the password fulfills certain criteria.

Sourceval login : email:string -> password:string -> (Sihl__.Contract_user.t, Sihl__.Contract_user.error) Result.t Lwt.t

Find user by email if password matches.

Sourceval register : unit -> Sihl__.Core_container.Service.t
Sourceval lifecycle : Sihl__.Core_container.lifecycle
OCaml

Innovation. Community. Security.