@experium/nest-bruteforce-guard
Version:
Authorization protection from bruteforce
38 lines (29 loc) • 720 B
Markdown
## Installation
```sh
# Locally in your project.
npm install @experium/nest-bruteforce-guard
```
## Configuration
```
import { BruteforceGuardModule } from 'nest-bruteforce-guard';
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);
```