← @mortar-kit/auth

Sealerinterface

import { Sealer } from '@mortar-kit/auth'

interface Sealer

Signs, checks and hashes values with the app's secret.

Properties

seal: (value: unknown, maxAge: number) => Promise<string>

value as a signed token that open accepts until maxAge seconds from now.

open: (token: string) => Promise<unknown>

The value inside a token from seal, or null if it was changed, signed with an unknown key, or has expired.

hash: (value: string) => Promise<string>

A keyed hash (hex) of value: what to store instead of a one-time token or code.