-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Invalidate AccessTokens on password change #3018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Many of the changes in the test file are whitespace-only, see https://github.com/strongloop/loopback/pull/3018/files?w=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested. All functions work for both email and password change.
LGTM
|
@slnode test please |
1 similar comment
|
@slnode test please |
common/models/user.js
Outdated
| }; | ||
|
|
||
| User._invalidateAccessTokensOfUsers = function(userIds, cb) { | ||
| if (!userIds.length) return cb(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check with !Array.isArray(userIds) || !userIds.length?
I think we need to use process.nextTick to cb() too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed - see 062c529
Invalidate all existing sessions (delete all access tokens) after user's password was changed.
062c529 to
29a17f3
Compare
Invalidate all existing sessions (delete all access tokens) after user's password was changed.
This patch supersedes #2665
Connect to strongloop-internal/scrum-loopback#925
@loay @raymondfeng PTAL