package sihl

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val lifecycle : Sihl__.Core_container.Lifecycle.t
val create : Core.Ctx.t -> kind:string -> ?data:string -> ?expires_in:Utils.Time.duration -> unit -> Sihl__.Token_core.t Lwt.t

Create a token and store a token.

Provide expires_in to define a duration in which the token is valid, default is one day. Provide data to store optional data as string.

val find : Core.Ctx.t -> string -> Sihl__.Token_core.t Lwt.t

Returns an active and non-expired token.

val find_opt : Core.Ctx.t -> string -> Sihl__.Token_core.t option Lwt.t

Returns an active and non-expired token.

OCaml

Innovation. Community. Security.