ninsho-hook-account-lock
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

ninsho-hook-account-lock

build and publish Coverage Status

Hook plugin for ninsho to lock accounts after multiple failed attempts.

Sample Code

hooks: [
  {
    hookPoint: 'beforePasswordCheck', // Fixed value
    hook: AccountLockHook(
      3, // failures_allowed_limit
      60 * 60 * 24, // account_unlock_duration_sec
    )
  },
]

Sample Source

https://github.com/ninsho/ninsho-example/blob/main/src/index.ts#L281

Required Arguments

The number of authentication failures that trigger an account lock.

failures_allowed_limit: number

The number of seconds until the account lock is lifted. If set to 0, the lock will not be lifted.

account_unlock_duration_sec: number

Optional arguments to set in "options"

The setting for whether to send a notification email when the number of unauthorized authentications exceeds the limit. The default is true (send).

sendLockNotice?: boolean

Overwriting the default email subject.

mailSubject?: string,

Overwriting the default email body.

mailBody?: string,

Required in API options

When using this hook, the following specification is required in the options of the API itself.

columnToRetrieve: [
  'failed_attempts',
  'last_failed_attempts_at'
],

Development Warning

This project is in development. Features may change without notice.

Readme

Keywords

none

Package Sidebar

Install

npm i ninsho-hook-account-lock

Weekly Downloads

1

Version

0.0.10

License

MIT

Unpacked Size

16.1 kB

Total Files

11

Last publish

Collaborators

  • ninka