|
|
|
@ -19,6 +19,9 @@ module.exports = function(db) {
|
|
|
|
|
var obj = {}
|
|
|
|
|
, email = sanitize(params.query.email)
|
|
|
|
|
|
|
|
|
|
db.get(email, function(err, value) {
|
|
|
|
|
if ((err && err.type == 'NotFoundError') || ! value.verified) {
|
|
|
|
|
|
|
|
|
|
console.log('got email:', params.query)
|
|
|
|
|
|
|
|
|
|
obj.token = rn()
|
|
|
|
@ -40,7 +43,6 @@ module.exports = function(db) {
|
|
|
|
|
from : config.email.from
|
|
|
|
|
, to : email
|
|
|
|
|
, subject: config.email.subject
|
|
|
|
|
//, link : link
|
|
|
|
|
, text : config.email.bodyText.replace(/\%link\%/, link)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -55,6 +57,9 @@ module.exports = function(db) {
|
|
|
|
|
return res.end()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
error('invalid input: '+ JSON.stringify(params.query))
|
|
|
|
|
}
|
|
|
|
|