cbargren / express-brute-mongoose Goto Github PK
View Code? Open in Web Editor NEWThis project forked from auth0/express-brute-mongo
Mongoose adapter for the express-brute middleware.
This project forked from auth0/express-brute-mongo
Mongoose adapter for the express-brute middleware.
I get this error:
Unhandled rejection MongoError: The field 'background' is not valid for an _id index specification. Specification: { v: 2, ns: "app.bruteforce", key: { _id: 1 }, name: "_id_1", background: true, unique: false }
but it goes away if I delete the _id field in the schema?
express-brute-mongoose is not working since express 4.9.8+.
TypeError: Cannot read property 'saveSubdocs' of undefined
Hello,
I'm new to nodejs and attempting to learn so I could easily be doing things wrong but how exactly do we check that this works? So far I've copied and pasted your sample code into my index.js changing the route to my "login" instead of "auth" and attempted making multiple api calls but I never get a 403 code kicked back. I also used robo mongo to check the DB for bruteforce collection entires but it's blank. Am I missing something?
TypeError: schema.virtuals[key]._applyDefaultGetters is not a function
Hi!
I have created a custom schema with additional properties, e.g. "userId" on the data field (along side count, lastRequest and firstRequest). However, these properties are not saved in mongo. I cannot figure out how to make this happen. Any input?
When I follow the readme, I get this error using the default schema:
/Applications/XAMPP/xamppfiles/htdocs/everest/node_modules/mongoose/lib/schema.js:362
throw new TypeError('Undefined type at `' + path +
^
TypeError: Undefined type at `paths._id`
Did you try nesting Schemas? You can only nest using refs or arrays.
at Function.Schema.interpretAsType (/Applications/XAMPP/xamppfiles/htdocs/everest/node_modules/mongoose/lib/schema.js:362:11)
at Schema.path (/Applications/XAMPP/xamppfiles/htdocs/everest/node_modules/mongoose/lib/schema.js:305:29)
at Schema.add (/Applications/XAMPP/xamppfiles/htdocs/everest/node_modules/mongoose/lib/schema.js:217:12)
at Schema.add (/Applications/XAMPP/xamppfiles/htdocs/everest/node_modules/mongoose/lib/schema.js:212:14)
at new Schema (/Applications/XAMPP/xamppfiles/htdocs/everest/node_modules/mongoose/lib/schema.js:73:10)
at Mongoose.model (/Applications/XAMPP/xamppfiles/htdocs/everest/node_modules/mongoose/lib/index.js:294:14)
at Object.<anonymous> (/Applications/XAMPP/xamppfiles/htdocs/everest/server/auth/local/index.js:15:22)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Applications/XAMPP/xamppfiles/htdocs/everest/server/auth/index.js:13:22)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
Mongoose ~4.5.0 doesn't support latest functionality.
Can it be upgraded to 4.9.* ?
Hi mate,
This doesn't work for node version 8.5.0. Could you please have a look into it?
It says that their is an unhandled promise.
Thanks.
Hi, great packages for brute force! In my current project, I am using winston for logging.
Is that any method or which file should I insert the logging line to have this result :)
I'm just trying to do an example app like in the readme. Trace below.
createWrapperSync('init', objToDecorate.$__init, null, kareemOptions);
^
TypeError: schema.s.hooks.createWrapperSync is not a function
at applyHooks (/Users/joshclark/dev/sandbox/security/rate-limit/express-brute/mongoose/node_modules/mongoose/lib/services/model/applyHooks.js:50:5)
at Function.compile (/Users/joshclark/dev/sandbox/security/rate-limit/express-brute/mongoose/node_modules/mongoose/lib/model.js:3782:3)
at Mongoose.model (/Users/joshclark/dev/sandbox/security/rate-limit/express-brute/mongoose/node_modules/mongoose/lib/index.js:381:22)
at Object.<anonymous> (/Users/joshclark/dev/sandbox/security/rate-limit/express-brute/mongoose/src/server.js:9:20)
at Module._compile (module.js:660:30)
at loader (/Users/joshclark/dev/sandbox/security/rate-limit/express-brute/mongoose/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/joshclark/dev/sandbox/security/rate-limit/express-brute/mongoose/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Function.Module.runMain (module.js:701:10)
at Object.<anonymous> (/Users/joshclark/dev/sandbox/security/rate-limit/express-brute/mongoose/node_modules/babel-cli/lib/_babel-node.js:154:22)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] babel-node: `babel-node --presets=env "src/server.js"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] babel-node script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/joshclark/.npm/_logs/2018-01-23T16_01_30_773Z-debug.log
[nodemon] app crashed - waiting for file changes before starting...
/Users/joshclark/dev/sandbox/security/rate-limit/express-brute/mongoose/node_modules/mongoose/lib/services/model/applyHooks.js:50
createWrapperSync('init', objToDecorate.$__init, null, kareemOptions);
^
TypeError: schema.s.hooks.createWrapperSync is not a function
at applyHooks (/Users/joshclark/dev/sandbox/security/rate-limit/express-brute/mongoose/node_modules/mongoose/lib/services/model/applyHooks.js:50:5)```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.