-
-
Notifications
You must be signed in to change notification settings - Fork 168
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] Call SIGNED_OUT
event where session is removed
#854
Merged
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
afb0ae8
fix: keep existing session on auth functions if they fail
bombillazo 09df436
Merge branch 'supabase:master' into master
bombillazo 6f2b4d6
Merge branch 'supabase:master' into master
bombillazo 1d5dace
Merge branch 'supabase:master' into master
bombillazo 75b5877
Merge branch 'supabase:master' into master
bombillazo b6a0847
Merge branch 'supabase:master' into master
bombillazo 88cedd7
chore: update function description comment
bombillazo 83716de
Merge branch 'master' of https://github.com/supabase/auth-js into sup…
bombillazo c84f1b8
Merge branch 'supabase-master'
bombillazo 72037fe
chore: update file code styling
bombillazo 7a68cf7
chore: update file styling
bombillazo 124e5f4
chore: update file styling
bombillazo 122145f
Merge branch 'supabase:master' into master
bombillazo f7ffdbc
Merge branch 'supabase:master' into master
bombillazo cff282f
chore: fix missing space
bombillazo ef0dd53
Merge remote-tracking branch 'upstream/master'
bombillazo b852b59
fix: send SIGNED_OUT wherever session is removed
bombillazo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
If the session isn't valid, then no one should've been signed in to begin with; so I'm not sure if triggering the event here is strictly necessary. Is it causing an issue, or are you just trying to cover all bases?
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.
_recoverAndRefresh
could be called with someone already in a signed in state, like from the_onVisibilityChanged
function. Also, we may have cookies during the client initialization we need to clear if the session is invalid, and by not triggering this event in the initial "no one is signed in to begin with" state, we get inconsistent issues. This is what is happening in our case. So, the way to avoid this is to trigger the SIGNED_OUT event every moment the session is removed, regardless of why it was removed. We also have logic that depends on reacting to the session that no longer exists in the client. This is also how it is described in the documentation: