Commit 55458af0 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

Merge branch 'MLAB-222' into 'testing'

an update on reset password

See merge request !113
parents c8891053 744144b9
Pipeline #4806 passed with stage
in 35 seconds
......@@ -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