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

an update on reset password

parent c8891053
3 merge requests!143updating yml config,!116Mlab 566,!113an update on reset password
This commit is part of merge request !113. Comments created here will be created in the context of that merge request.
Showing with 5 additions and 3 deletions
+5 -3
......@@ -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