AfterLoginFailedFunction
AfterLoginFailedFunction = (
params) =>Promise<void>
Called after password login attempt failed, right before AdminForth answers with 401.
Not called for attempts blocked by auth.rateLimit.
Useful to log failed attempts or to notify user about bruteforce of their account.
Can't change response of the login request: thrown error is logged and login still answers with 401.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { adminforth: IAdminForth; extra: HttpExtra; pk: string | null; reason: LoginFailureReason; username: string; } | - |
params.adminforth | IAdminForth | Adminforth instance. |
params.extra | HttpExtra | Extra HTTP information of login request. |
params.pk | string | null | Primary key of user with such username. Is null when reason is rejected or user_not_found. |
params.reason | LoginFailureReason | Why login attempt failed. |
params.username | string | Username which user tried to login with, normalized in same way as it is stored in database. |
Returns
Promise<void>