12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273openSihl_typemoduletypeSig=sigincludeSihl_core.Container.Service.Sigvalfind_all:query:Database.Ql.t->(User.tlist*Database.Meta.t)Lwt.tvalfind_opt:user_id:string->User.toptionLwt.tvalfind:user_id:string->User.tLwt.tvalfind_by_email:email:string->User.tLwt.tvalfind_by_email_opt:email:string->User.toptionLwt.tvalupdate_password:?password_policy:(string->(unit,string)Result.t)->user:User.t->old_password:string->new_password:string->new_password_confirmation:string->unit->(User.t,string)Result.tLwt.tvalupdate_details:user:User.t->email:string->username:stringoption->User.tLwt.t(** Set the password of a user without knowing the old password.
This feature is typically used by admins. *)valset_password:?password_policy:(string->(unit,string)Result.t)->user:User.t->password:string->password_confirmation:string->unit->(User.t,string)Result.tLwt.t(** Create and store a user. *)valcreate_user:email:string->password:string->username:stringoption->User.tLwt.t(** Create and store a user that is also an admin. *)valcreate_admin:email:string->password:string->username:stringoption->User.tLwt.t(** Create and store new user.
Provide [password_policy] to check whether the password fulfills certain criteria. *)valregister_user:?password_policy:(string->(unit,string)result)->?username:string->email:string->password:string->password_confirmation:string->unit->(User.t,User.Error.t)Result.tLwt.t(** Find user by email if password matches. *)vallogin:email:string->password:string->(User.t,User.Error.t)Result.tLwt.tvalregister:unit->Sihl_core.Container.Service.tmoduleSeed:sigvaladmin:email:string->password:string->User.tLwt.tvaluser:email:string->password:string->?username:string->unit->User.tLwt.tendend