express-forgot-password
Advanced tools
Comparing version 0.0.0 to 0.1.0
var express = require('express') | ||
, ForgotPassword = require('./model') | ||
, ForgotPassword = require('./model')(mongoose) | ||
module.exports = function(co, Customer){ | ||
module.exports = function(config, mongoose, Customer){ | ||
@@ -6,0 +6,0 @@ var app = express() |
module.exports = function(opts){ | ||
return { | ||
app : require('./app')(opts.config, opts.user) | ||
app : require('./app')(opts.config, opts.mongoose, opts.user) | ||
} | ||
} |
12
model.js
@@ -1,5 +0,7 @@ | ||
var mongoose = require('mongoose') | ||
, Schema = mongoose.Schema | ||
, crypto = require('crypto') | ||
var crypto = require('crypto') | ||
module.exports = function(mongoose) { | ||
var Schema = mongoose.Schema | ||
var _createCode = function(){ | ||
@@ -60,3 +62,5 @@ return crypto.randomBytes(10).toString('hex') | ||
var ForgotPassword = module.exports = mongoose.model('ForgotPassword', ForgotPasswordSchema) | ||
var ForgotPassword = mongoose.model('ForgotPassword', ForgotPasswordSchema) | ||
return Forgot Password | ||
} |
{ | ||
"name": "express-forgot-password", | ||
"version": "0.0.0", | ||
"version": "0.1.0", | ||
"description": "Express Forgotton Password sub-app", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,3 +6,4 @@ # Forgot Password Flow | ||
## Assumptions: | ||
- Mongodb | ||
- Mongodb / mongoose | ||
- User model has `.findByEmail` | ||
@@ -13,5 +14,5 @@ ## Usage: | ||
var forgotton = require('express-forgotton-password')({ config: config, db : db, user : UserModel }) | ||
var forgotton = require('express-forgotton-password')({ config: config, mongoose: mongoose, user : UserModel }) // Passing mongoose here _sucks_ | ||
app.use(forgotton.app) | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68733
18
105
17