Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
User Account
Commits
744144b9
Commit
744144b9
authored
Sep 06, 2021
by
Rosanny Sihombing
Browse files
an update on reset password
parent
c8891053
Changes
1
Hide whitespace changes
Inline
Side-by-side
routes/public.ts
View file @
744144b9
...
...
@@ -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 notifi
a
ction email
// send notific
a
tion email
mailer
.
options
.
to
=
user
.
email
mailer
.
options
.
subject
=
constants
.
updatePasswordMailSubject
mailer
.
options
.
html
=
constants
.
updatePasswordMailContent
+
'
<div>
'
+
constants
.
mailSignature
+
'
</div>
'
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment