Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
simcaq-node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simcaq
simcaq-node
Commits
4ef2c6e6
Commit
4ef2c6e6
authored
7 years ago
by
Gustavo Soviersovski
Browse files
Options
Downloads
Patches
Plain Diff
Expiring resetToken and passwordChange request working
parent
2df07471
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!116
Release v1.0.0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libs/models/resetToken.js
+2
-1
2 additions, 1 deletion
src/libs/models/resetToken.js
src/libs/models/user.js
+2
-2
2 additions, 2 deletions
src/libs/models/user.js
with
4 additions
and
3 deletions
src/libs/models/resetToken.js
+
2
−
1
View file @
4ef2c6e6
...
@@ -23,7 +23,8 @@ let ResetToken = new Schema({
...
@@ -23,7 +23,8 @@ let ResetToken = new Schema({
createdAt
:
{
createdAt
:
{
type
:
Date
,
type
:
Date
,
required
:
true
,
required
:
true
,
default
:
Date
.
now
default
:
Date
.
now
,
expires
:
86400
//Seconds in a Day
}
}
});
});
...
...
This diff is collapsed.
Click to expand it.
src/libs/models/user.js
+
2
−
2
View file @
4ef2c6e6
...
@@ -74,11 +74,11 @@ var UserSchema = new Schema({
...
@@ -74,11 +74,11 @@ var UserSchema = new Schema({
});
});
UserSchema
.
methods
.
encryptPassword
=
function
(
password
)
{
UserSchema
.
methods
.
encryptPassword
=
function
(
password
)
{
return
crypto
.
pbkdf2Sync
(
password
,
this
.
salt
,
10000
,
512
,
'
sha512
'
);
return
crypto
.
pbkdf2Sync
(
password
+
''
,
this
.
salt
,
10000
,
512
,
'
sha512
'
);
};
};
UserSchema
.
virtual
(
'
password
'
).
set
(
function
(
password
)
{
UserSchema
.
virtual
(
'
password
'
).
set
(
function
(
password
)
{
this
.
_plainPassword
=
password
;
this
.
_plainPassword
=
password
+
''
;
this
.
salt
=
crypto
.
randomBytes
(
128
).
toString
(
'
hex
'
);
this
.
salt
=
crypto
.
randomBytes
(
128
).
toString
(
'
hex
'
);
this
.
hashedPassword
=
this
.
encryptPassword
(
password
).
toString
(
'
hex
'
);
this
.
hashedPassword
=
this
.
encryptPassword
(
password
).
toString
(
'
hex
'
);
}).
get
(
function
()
{
}).
get
(
function
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment