Skip to content

fix(auth): fail a global or others sign out answered with session_not_found - #2108

Merged
spydon merged 1 commit into
mainfrom
lukasklingsbo/sdk-2600-auth-a-global-or-others-sign-out-answered-403
Oct 29, 2026
Merged

spydon merged 1 commit into
mainfrom
lukasklingsbo/sdk-2600-auth-a-global-or-others-sign-out-answered-403

Conversation

@spydon

@spydon spydon commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary

signOut treated a 403 session_not_found from /logout as "already signed out" for every scope. That answer only means the current session is gone, while the other sessions of the user can still exist. So:

  • signOut(scope: SignOutScope.global) removed the local session, emitted signedOut and returned success, although the other sessions were still alive.
  • signOut(scope: SignOutScope.others) returned success without having revoked anything.

Following the error table of the proposed sign out spec (supabase/sdk#302):

Server answer local global others
204 Success Success Success
403 user_not_found Already signed out Already signed out Already signed out
403 session_not_found Already signed out Throws, local session kept Throws, local session kept

For global the local session is kept on that failure, so the app can fall back to SignOutScope.local to sign out the device. The signOut dartdoc now says so.

Tests

sign_out_scope_test.dart gets a group that runs each scope against 204, 403 user_not_found and 403 session_not_found, checking the local session, the emitted events and, for the failures, the thrown error code. The old global test that expected success on session_not_found is replaced, and an others test made redundant by the new group is removed.

Fixes SDK-2600

@github-actions github-actions Bot added the auth This issue or pull request is related to authentication label Oct 29, 2026
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between cdfd66c and ae639c7.

Files selected for processing: 2
  • packages/supabase_auth/lib/src/auth_client.dart
  • packages/supabase_auth/test/sign_out_scope_test.dart
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@spydon
spydon merged commit 95a2fc5 into main Oct 29, 2026
44 checks passed
@spydon
spydon deleted the lukasklingsbo/sdk-2600-auth-a-global-or-others-sign-out-answered-403 branch October 29, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth This issue or pull request is related to authentication

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant