package sihl

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Service.MakeSource

Parameters

Signature

include Core.Container.SERVICE
Sourceval lifecycle : Core__.Core_container.Lifecycle.t
Sourceval create : Core.Ctx.t -> kind:string -> ?data:string -> ?expires_in:Utils.Time.duration -> unit -> Token__.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.

Sourceval find : Core.Ctx.t -> string -> Token__.Token_core.t Lwt.t

Returns an active and non-expired token.

Sourceval find_opt : Core.Ctx.t -> string -> Token__.Token_core.t option Lwt.t

Returns an active and non-expired token.

OCaml

Innovation. Community. Security.