-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix(#3898): session token deletion #3937
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
Codecov Report
@@ Coverage Diff @@
## master #3937 +/- ##
==========================================
+ Coverage 90.43% 90.48% +0.05%
==========================================
Files 114 114
Lines 7682 7686 +4
==========================================
+ Hits 6947 6955 +8
+ Misses 735 731 -4
Continue to review full report at Codecov.
|
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.
lgtm
@@ -2205,6 +2206,50 @@ describe('Parse.User testing', () => { | |||
}); | |||
}); | |||
|
|||
it('cannot update session if invalid or no session token', (done) => { | |||
Parse.Promise.as().then(() => { |
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.
hm. just out of curiosity, why do you need this noop promise?
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.
not needed per se, but that's how the test was originally written.
src/rest.js
Outdated
|
||
const firstResult = response.results[0]; | ||
firstResult.className = className; | ||
if (className == '_Session' && !auth.isMaster) { |
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.
prefer === i should prolly get that in lint....surprised it isn't already there.
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.
👍
Makes sure the user trying to make the delete call on _Session is the one owning it. Props to @pungme for writing the test and getting it started!