Os_current_userSourceinclude module type of struct include Os.Current_user endOn server side, this will work only if the current request in wrapped in Session.connected_wrapper, or Session.connected_fun, etc. Otherwise, an exception is raised.
type current_user = Os.Current_user.current_user = | CU_idontknown| CU_notconnected| CU_user of Os.Types.User.tval get_current_user : unit -> Os.Types.User.tget_current_user () returns the current user as a Types.User.t type. If no user is connected, it fails with Session.Not_connected.
val get_current_userid : unit -> Os.Types.User.idget_current_userid () returns the ID of the current user. If no user is connected, it fails with Session.Not_connected.
module Opt = Os.Current_user.OptInstead of exception, the module Opt returns an option.
remove_email_from_user email removes the email email of the current user. If no user is connected, it fails with Session.Not_connected. If email is the main email of the current user, it fails with Db.Main_email_removal_attempt.
update_main_email email sets the main email of the current user to email. If no user is connected, it fails with Session.Not_connected.
update_language language updates the language of the current user. If no user is connected, it fails with Session.Not_connected.
is_email_validated email returns true if email is a valided email for the current user. If no user is connected, it fails with Session.Not_connected. It returns false in all other cases.