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
31acd6d0
Commit
31acd6d0
authored
Dec 09, 2019
by
Wolfgang Knopki
Browse files
token reset passwd
parent
f53cb8e1
Pipeline
#359
passed with stage
in 8 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
config/config.js
View file @
31acd6d0
module
.
exports
=
{
development
:
{
app
:
{
hostname
:
'
m4lab.hft-stuttgart.de/account
/
'
,
hostname
:
'
m4lab.hft-stuttgart.de/account
'
,
name
:
'
User Account Management
'
,
port
:
process
.
env
.
PORT
||
9989
},
...
...
routes/routes.js
View file @
31acd6d0
...
...
@@ -364,11 +364,12 @@ module.exports = function (app, config, passport) {
});
app
.
post
(
'
/reset/:token
'
,
function
(
req
,
res
)
{
var
newPwd
=
req
.
body
.
inputNewPwd
methods
.
checkUserToken
(
req
.
params
.
token
,
function
(
err
,
user
){
if
(
user
)
{
// update password
bcrypt
.
genSalt
(
saltRounds
,
function
(
err
,
salt
)
{
bcrypt
.
hash
(
req
.
params
.
inputN
ewPwd
,
salt
,
function
(
err
,
hash
)
{
bcrypt
.
hash
(
n
ewPwd
,
salt
,
function
(
err
,
hash
)
{
methods
.
updatePassword
(
hash
,
user
.
email
,
function
(
err
){
if
(
err
)
{
req
.
flash
(
'
error
'
,
"
Database error: Password cannot be modified.
"
)
...
...
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