Skip to main content

countAttempt

@webda/auth


Function: countAttempt()

countAttempt(ref, attrCount, attrTs, params?, currentSnapshot?): Promise<boolean>

Defined in: packages/core/lib/utils/throttle.d.ts:17

Atomic attempt counting and lockout check generalised across stores and models

Parameters​

ref​

any

model reference (e.g. ident.ref(), user.ref())

attrCount​

string

attribute name tracking attempts (e.g. "_loginAttempts", "_mfaAttempts")

attrTs​

string

attribute name tracking last attempt timestamp (e.g. "_lastLoginAttemptAt", "_lastMfaAttemptAt")

params?​

ThrottleParameters

throttle parameters

currentSnapshot?​

any

optional current in-memory record

Returns​

Promise<boolean>

true if this attempt is locked out