Skip to content
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

feat: Allow logout with invalid session token #1803

Open
wants to merge 15 commits into
base: alpha
Choose a base branch
from

Conversation

dblythy
Copy link
Member

@dblythy dblythy commented Mar 2, 2023

Pull Request

Issue

Currently, if trying to logout with an invalid session token, you will need to catch the error, and call logout again. It can be a bit tedious.

Closes: #307

Approach

Improves clearing session by allowing Parse.User.logOut({ clearSession: true }), which resolves even if invalid session token is returned.

Tasks

  • Add tests

@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title feat: allow logout with invalid session token feat: Allow logout with invalid session token Mar 2, 2023
@parse-github-assistant
Copy link

Thanks for opening this pull request!

@codecov
Copy link

codecov bot commented Mar 2, 2023

Codecov Report

Patch coverage: 87.50% and project coverage change: -0.02% ⚠️

Comparison is base (ca568a6) 100.00% compared to head (96cd284) 99.98%.
Report is 1 commits behind head on alpha.

❗ Current head 96cd284 differs from pull request most recent head 173d915. Consider uploading reports for the commit 173d915 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##             alpha    #1803      +/-   ##
===========================================
- Coverage   100.00%   99.98%   -0.02%     
===========================================
  Files           61       61              
  Lines         6168     6173       +5     
  Branches      1499     1500       +1     
===========================================
+ Hits          6168     6172       +4     
- Misses           0        1       +1     
Files Changed Coverage Δ
src/ParseUser.js 99.81% <87.50%> (-0.19%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mtrezza
Copy link
Member

mtrezza commented Mar 2, 2023

Currently, if trying to logout with an invalid session token, you will need to catch the error, and call logout again.

What would be the difference between the first and second logout request? What makes the first fail and the second succeed?

@mtrezza
Copy link
Member

mtrezza commented Jul 23, 2023

@dblythy Friendly ping regarding the previous question. If the 1st logout attempt fails, why does the 2nd attempt (after catching the error) succeed?

@dplewis
Copy link
Member

dplewis commented Sep 3, 2023

@dblythy We should add this to the server side like parse-community/parse-server#8722 so that it can work for all SDK's

@mtrezza I have no idea why there is a need to call Parse.User.logOut twice when there is a invalid session error to log out. I've been running into this issue a lot while fixing sessionToken invalid issues.

@mtrezza
Copy link
Member

mtrezza commented Sep 3, 2023

Could you please open a separate issue for this?

@dblythy
Copy link
Member Author

dblythy commented Sep 3, 2023

@dplewis see parse-community/parse-server#7277 (comment)

@kishanio
Copy link

are we still tracking this?

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.

Improving Invalid Session Handling
4 participants