Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
3 years ago
by
Rosanny Sihombing
Browse files
Options
Download
Email Patches
Plain Diff
an update on reset password
parent
c8891053
master
MLAB-677
devel
reset-jul13
reset-merge
testing
3 merge requests
!143
updating yml config
,
!116
Mlab 566
,
!113
an update on reset password
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
routes/public.ts
+5
-3
routes/public.ts
with
5 additions
and
3 deletions
+5
-3
routes/public.ts
+
5
-
3
View file @
744144b9
...
@@ -237,9 +237,11 @@ export = function (app:any, config:any, lang:string) {
...
@@ -237,9 +237,11 @@ export = function (app:any, config:any, lang:string) {
// encrypt password
// encrypt password
bcrypt
.
genSalt
(
saltRounds
,
function
(
err
,
salt
)
{
bcrypt
.
genSalt
(
saltRounds
,
function
(
err
,
salt
)
{
bcrypt
.
hash
(
newPwd
,
salt
,
async
function
(
err
:
any
,
hash
)
{
bcrypt
.
hash
(
newPwd
,
salt
,
async
function
(
err
:
any
,
hash
)
{
var
credentialData
=
{
let
credentialData
=
{
password
:
hash
,
password
:
hash
,
user_id
:
user
.
user_id
user_id
:
user
.
user_id
,
resetPasswordToken
:
null
,
resetPasswordExpires
:
null
}
}
// update password
// update password
let
result
=
await
methods
.
updateCredential
(
credentialData
)
let
result
=
await
methods
.
updateCredential
(
credentialData
)
...
@@ -248,7 +250,7 @@ export = function (app:any, config:any, lang:string) {
...
@@ -248,7 +250,7 @@ export = function (app:any, config:any, lang:string) {
res
.
flash
(
'
error
'
,
"
Datenbankfehler: Passwort kann nicht geändert werden.
"
)
res
.
flash
(
'
error
'
,
"
Datenbankfehler: Passwort kann nicht geändert werden.
"
)
}
else
{
}
else
{
res
.
flash
(
'
success
'
,
"
Passwort aktualisiert!
"
)
res
.
flash
(
'
success
'
,
"
Passwort aktualisiert!
"
)
// send notifi
a
ction email
// send notific
a
tion email
mailer
.
options
.
to
=
user
.
email
mailer
.
options
.
to
=
user
.
email
mailer
.
options
.
subject
=
constants
.
updatePasswordMailSubject
mailer
.
options
.
subject
=
constants
.
updatePasswordMailSubject
mailer
.
options
.
html
=
constants
.
updatePasswordMailContent
+
'
<div>
'
+
constants
.
mailSignature
+
'
</div>
'
mailer
.
options
.
html
=
constants
.
updatePasswordMailContent
+
'
<div>
'
+
constants
.
mailSignature
+
'
</div>
'
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets