Sihl_user.MakeSourcemodule Repo : sig ... endfind_by_email email returns a User.t if there is a user with email address email. Raises an {!Exception} otherwise.
find_by_email_opt email returns a User.t if there is a user with email address email.
val 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.tSet the password of a user without knowing the old password.
This feature is typically used by admins.
val create_user :
email:string ->
password:string ->
username:string option ->
Sihl__.Contract_user.t Lwt.tCreate and store a user.
val create_admin :
email:string ->
password:string ->
username:string option ->
Sihl__.Contract_user.t Lwt.tCreate and store a user that is also an admin.
val 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.tCreate and store new user.
Provide password_policy to check whether the password fulfills certain criteria.
val login :
email:string ->
password:string ->
(Sihl__.Contract_user.t, Sihl__.Contract_user.error) Result.t Lwt.tFind user by email if password matches.