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

Fix too early UserManager.events().unload() event before user is actually signed out #1342

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

PSanetra
Copy link
Contributor

This PR prevents race conditions with event handlers which react to this unload event and expect the user to be signed out already.

Fixes #1341

@pamapa pamapa added this to the 3.0.0 milestone Jan 15, 2024
Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4a8d6d9) 78.33% compared to head (1ad5d00) 79.78%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1342      +/-   ##
==========================================
+ Coverage   78.33%   79.78%   +1.44%     
==========================================
  Files          45       45              
  Lines        1731     1731              
  Branches      344      344              
==========================================
+ Hits         1356     1381      +25     
+ Misses        338      312      -26     
- Partials       37       38       +1     
Flag Coverage Δ
unittests 79.78% <100.00%> (+1.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

src/UserManager.ts Outdated Show resolved Hide resolved
…s actually signed out

Prevents race conditions with event handlers which react to this unload event and expect the user to be signed out already.

Fixes authts#1341
@PSanetra PSanetra force-pushed the fix-too-early-user-unloaded-event branch from 4acc543 to 1ad5d00 Compare January 15, 2024 15:44
@pamapa pamapa merged commit 5508683 into authts:main Jan 15, 2024
4 checks passed
@pamapa
Copy link
Member

pamapa commented Jan 15, 2024

thanks for contributing

@PSanetra
Copy link
Contributor Author

@pamapa Thank you for reacting so fast! 🚀
Is it possible to release a new RC version with this change?

@pamapa
Copy link
Member

pamapa commented Jan 15, 2024

@PSanetra Yes, i can make one in the next few days (1-3)...

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.

UserManager.events().unload() event is triggered too early on UserManager.signoutRedirect()
2 participants