Navigation Menu

Skip to content

Commit

Permalink
use updated sendmail module
Browse files Browse the repository at this point in the history
  • Loading branch information
zemirco committed May 23, 2014
1 parent ed8107c commit 282406a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions index.js
Expand Up @@ -5,7 +5,7 @@ var uuid = require('node-uuid');
var pwd = require('couch-pwd');
var ms = require('ms');
var moment = require('moment');

var Mail = require('lockit-sendmail');


/**
Expand All @@ -30,8 +30,6 @@ var ForgotPassword = module.exports = function(config, adapter) {
this.config = config;
this.adapter = adapter;

var Mail = this.Mail = require('lockit-sendmail')(config);

// set default route
var route = config.forgotPassword.route || '/forgot-password';

Expand Down Expand Up @@ -87,7 +85,6 @@ ForgotPassword.prototype.getForgot = function(req, res, next) {
ForgotPassword.prototype.postForgot = function(req, res, next) {
var config = this.config;
var adapter = this.adapter;
var Mail = this.Mail;

var email = req.body.email;

Expand Down Expand Up @@ -150,8 +147,8 @@ ForgotPassword.prototype.postForgot = function(req, res, next) {
if (err) return next(err);

// send email with forgot password link
var mail = new Mail('emailForgotPassword');
mail.send(user.name, user.email, token, function(err, response) {
var mail = new Mail(config);
mail.forgot(user.name, user.email, token, function(err, response) {
if (err) return next(err);

// send only JSON when REST is active
Expand Down

0 comments on commit 282406a

Please sign in to comment.