Skip to content
On this page

Function: parseSignInRequirement()

TypeScript
function parseSignInRequirement(requirement: unknown): {
  amr: ("bip322" | "email" | "passkey" | "google" | "github")[];
  maxAge?: number;
};

Defined in: sign-in.ts:60 (opens in a new tab)

requirement as satisfiesSignInRule reads it. Throws on one it cannot read: not an object, a key other than amr and maxAge, a method outside AUTH_METHODS, or a maxAge that is not a whole number of seconds from 0. A misspelt key would otherwise require nothing.

ParametersLink to this section

ParameterType
requirementunknown

ReturnsLink to this section

TypeScript
{
  amr: ("bip322" | "email" | "passkey" | "google" | "github")[];
  maxAge?: number;
}
NameTypeDefined in
amr("bip322" | "email" | "passkey" | "google" | "github")[]sign-in.ts:60 (opens in a new tab)
maxAge?numbersign-in.ts:60 (opens in a new tab)