Module 1-UserService.Web
val user_from_token : ?ctx:(string * string) list -> ?key:string -> (?ctx:(string * string) list -> string -> k:string -> string option Lwt.t) -> Rock.Request.t -> Sihl.Contract.User.t option Lwt.tuser_from_token ?ctx ?key read_token requestreturns the user that is associated to the user id in theBearertoken of therequest.keyis the key in the token associated with the user id. By default, the value isuser_id.read_tokenis a function that returns the associated value ofkeyin a given token.
val user_from_session : ?ctx:(string * string) list -> ?cookie_key:string -> ?secret:string -> ?key:string -> Rock.Request.t -> Sihl.Contract.User.t option Lwt.tuser_from_session ?ctx ?cookie_key ?secret ?key ?secret requestreturns the user that is associated to the user id in the session of therequest.cookie_keyis the name/key of the session cookie. By default, the value is_session.secretis used to verify the signature of the session cookie. By default,SIHL_SECRETis used.keyis the key in the session associated with the user id. By default, the value isuser_id.