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
| Parameter | Type |
|---|---|
args | { email: string; purpose: OneTimeTokenPurpose; since: Date; } |
args.email | string |
args.purpose | OneTimeTokenPurpose |
args.since | Date |
Returns
Promise<Date[]> | Date[]
record
record: (
args) =>Promise<void> |void
Defined in: auth-core/src/emailAuthTypes.ts:170
Record one request.
Parameters
| Parameter | Type |
|---|---|
args | { email: string; purpose: OneTimeTokenPurpose; requestedAt: Date; } |
args.email | string |
args.purpose | OneTimeTokenPurpose |
args.requestedAt | Date |
Returns
Promise<void> | void