@authlocal/authlocal
Version:
User-sovereign Logins For All
22 lines (21 loc) • 932 B
TypeScript
import { Proof } from "./proof.js";
import { ClaimPayload } from "./types.js";
import { TokenVerifyOptions } from "../jwt/types.js";
/**
* Login claim token -- make any verifiable claim on behalf of your user
* - contains any arbitrary data, signed by the user's login
* - verification of a claim token requires a proof token
* - you can send this to any of your services, along with the proof token for verification
*/
export declare class Claim<C> {
readonly proof: Proof;
readonly token: string;
readonly payload: ClaimPayload<C>;
constructor(proof: Proof, token: string, payload: ClaimPayload<C>);
get thumbprint(): string;
get expiresAt(): number;
get data(): C;
isExpired(): boolean;
static decode<C>(claimToken: string): import("../jwt/types.js").WebToken<ClaimPayload<C>>;
static verify<C>(proof: Proof, claimToken: string, options?: TokenVerifyOptions): Promise<Claim<C>>;
}