Skip to main content

Type Alias: RequestRateLimitStore

RequestRateLimitStore = object

Defined in: auth-core/src/emailAuthTypes.ts:159

App-provided record of how often each address has asked for mail.

Without this, anyone can point the "mail me something" endpoints at a stranger's address and make the application send to it repeatedly. Capping how many codes are valid does not help — that limits redemptions, not messages.

Properties

recent

recent: (args) => Promise<Date[]> | Date[]

Defined in: auth-core/src/emailAuthTypes.ts:164

Timestamps of the requests recorded for this address and purpose at or after since, in any order.

Parameters

ParameterType
args{ email: string; purpose: OneTimeTokenPurpose; since: Date; }
args.emailstring
args.purposeOneTimeTokenPurpose
args.sinceDate

Returns

Promise<Date[]> | Date[]


record

record: (args) => Promise<void> | void

Defined in: auth-core/src/emailAuthTypes.ts:170

Record one request.

Parameters

ParameterType
args{ email: string; purpose: OneTimeTokenPurpose; requestedAt: Date; }
args.emailstring
args.purposeOneTimeTokenPurpose
args.requestedAtDate

Returns

Promise<void> | void