Creates a new sessionToken when updating password#2266
Merged
Conversation
| // Session token should have changed | ||
| expect(user.sessionToken).not.toEqual(originalSessionToken); | ||
| // test that the sessionToken is valid | ||
| return new Promise((resolve, reject) => { |
Contributor
There was a problem hiding this comment.
We have request-promise now if you want to avoid some boilerplate in later PRs.
Contributor
Author
There was a problem hiding this comment.
That's helpful. I'll update
Contributor
|
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. |
Contributor
Author
|
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; |
Contributor
There was a problem hiding this comment.
You might find jasmine spies more convenient. This is fine here though.
rsouzas
pushed a commit
to back4app/parse-server
that referenced
this pull request
Mar 15, 2017
* Creates a new sessionToken when updating password * Adds test ensuring email is properly sent when upgrading from anon
rsouzas
pushed a commit
to back4app/parse-server
that referenced
this pull request
Mar 16, 2017
* Creates a new sessionToken when updating password * Adds test ensuring email is properly sent when upgrading from anon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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