-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Creates a new sessionToken when updating password #2266
Conversation
// Session token should have changed | ||
expect(user.sessionToken).not.toEqual(originalSessionToken); | ||
// test that the sessionToken is valid | ||
return new Promise((resolve, reject) => { |
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.
We have request-promise
now if you want to avoid some boilerplate in later PRs.
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.
That's helpful. I'll update
Can you add a test that verification email is sent when upgrading to non-anon and setting email? Also, postgres tests are failing, we may need to add another exclude. |
Yup! |
@flovilmart updated the pull request. |
1 similar comment
@flovilmart updated the pull request. |
|
||
it_exclude_dbs(['postgres'])('should send email when upgrading from anon', (done) => { | ||
|
||
let emailCalled = false; |
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.
You might find jasmine spies more convenient. This is fine here though.
* Creates a new sessionToken when updating password * Adds test ensuring email is properly sent when upgrading from anon
* Creates a new sessionToken when updating password * Adds test ensuring email is properly sent when upgrading from anon
When upgrading a user from anonymous to username/password the original implementation would force the client to call login in order to generate a session token.
This PR attempts to fix that problem by generating a new session token after clearing the sessions.
Fixes #2252