0.0.10 • Published 2 years ago

ninsho-hook-account-lock v0.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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.

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago