Skip to content

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

Merged
merged 2 commits into from
Jun 16, 2017
Merged

fix(#3898): session token deletion #3937

merged 2 commits into from
Jun 16, 2017

Conversation

flovilmart
Copy link
Contributor

@flovilmart flovilmart commented Jun 16, 2017

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!

@codecov
Copy link

codecov bot commented Jun 16, 2017

Codecov Report

Merging #3937 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/rest.js 97.33% <100%> (+0.15%) ⬆️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 95.83% <0%> (+0.13%) ⬆️
src/RestWrite.js 93.29% <0%> (+0.19%) ⬆️
src/Routers/SessionsRouter.js 90.24% <0%> (+4.87%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d79ba1...8efd5cb. Read the comment docs.

@flovilmart flovilmart requested a review from acinader June 16, 2017 14:57
acinader
acinader previously approved these changes Jun 16, 2017
Copy link
Contributor

@acinader acinader left a 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(() => {
Copy link
Contributor

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?

Copy link
Contributor Author

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) {
Copy link
Contributor

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.

Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@flovilmart flovilmart merged commit 16954c2 into master Jun 16, 2017
@flovilmart flovilmart deleted the fix/3896 branch June 16, 2017 16:56
@flovilmart flovilmart modified the milestone: 2.5.0 Jun 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants