express-forgot-password

Express Forgotton Password sub-app

npm install express-forgot-password
7 downloads in the last day
70 downloads in the last week
290 downloads in the last month

Forgot Password Flow

Express sub-app for a forgotton password flow.

Assumptions:

  • Mongodb / mongoose
  • User model has .findByEmail

Usage:


var forgotton = require('express-forgotton-password')({ 
 // None of this is optional :(
  mailConfig: config // config for nodemailer
, mailFrom: "nomail" // mailer from address
, db: mongoose
, resetMailSubject : "Reset yout mysite password"
, resetMailContent : function(user, token){ 
    return "reset link: http://mysite" + token + " \n thanks" 
  }
, user : UserModel })
app.use(forgotton.app)
npm loves you