package sihl-token

  1. Overview
  2. Docs
val user : ?key:string -> (string -> Sihl__.Contract_user.t option Lwt.t) -> Rock.Middleware.t

user ?key find_user returns a middleware that sets the current user based on the Bearer Token in the Authorization header.

key is the user id that has been used to store a user id in the session. Be default, the value is user_id.

find_user is a function that returns a user given a user id.

OCaml

Innovation. Community. Security.