0.1.0 • Published 5 years ago

express-brute-firestore v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

express-brute-firestore

A Firestore store for express-brute.

npm version npm downloads per month

Installation

Install the latest version of express-brute-firestore: (note: this package requires NodeJs >= 7.6)

npm install express-brute-firestore --save

// or, with yarn
yarn add express-brute-firestore

Usage

const express = require('express');
const ExpressBrute = require('express-brute');
const FirestoreStore = require('express-brute-firestore');
const admin = require('firebase-admin');

admin.initializeApp();

const app = express();
const store = new FirestoreStore(admin.firestore(), 'BRUTE_FORCE_COLLECTION');

const bruteGuard = new ExpressBrute(store);

app.post('/unprotected-route', bruteGuard.prevent, (req, res) => { /* your usual logic */ });

Copyright & License

Copyright (c) 2019 Marcel de Oliveira Coelho under the MIT License. Go Crazy. :rocket: