@experium/nest-bruteforce-guard
TypeScript icon, indicating that this package has built-in type declarations

1.0.35 • Public • Published

Installation

# Locally in your project.
npm install @experium/nest-bruteforce-guard

Configuration

import { BruteforceGuardModule } from 'nest-bruteforce-guard';

@Module({
    imports: [
        //...
        BruteforceGuardModule.setUp({
            attemptMinutesByLogin: 120,
            attemptMinutesByIp: 30,
            attemptCountByLogin: 5,
            attemptCountByIp: 10,
        })
    ],
})
export class ApplicationModule {
}

Usage


### Save attempt when login failed by password
await this.bruteforceGuard.saveLoginAttempt(user.username, request.ip);

### Clear attempts when login success
await this.bruteforceGuard.clearLoginAttempts(user.username, request.ip);

Package Sidebar

Install

npm i @experium/nest-bruteforce-guard

Weekly Downloads

1

Version

1.0.35

License

MIT

Unpacked Size

61.1 kB

Total Files

58

Last publish

Collaborators

  • experium