Commit 744144b9 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

an update on reset password

parent c8891053
......@@ -237,9 +237,11 @@ export = function (app:any, config:any, lang:string) {
// encrypt password
bcrypt.genSalt(saltRounds, function(err, salt) {
bcrypt.hash(newPwd, salt, async function(err:any, hash) {
var credentialData = {
let credentialData = {
password: hash,
user_id: user.user_id
user_id: user.user_id,
resetPasswordToken: null,
resetPasswordExpires: null
}
// update password
let result = await methods.updateCredential(credentialData)
......@@ -248,7 +250,7 @@ export = function (app:any, config:any, lang:string) {
res.flash('error', "Datenbankfehler: Passwort kann nicht geändert werden.")
} else {
res.flash('success', "Passwort aktualisiert!")
// send notifiaction email
// send notification email
mailer.options.to = user.email
mailer.options.subject = constants.updatePasswordMailSubject
mailer.options.html = constants.updatePasswordMailContent+'<div>'+constants.mailSignature+'</div>'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment