Skip to content

feat(auth): add admin sign_out - #2108

Merged
spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2735-auth-add-admin-sign-out
Nov 17, 2026
Merged

spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2735-auth-add-admin-sign-out

Conversation

@spydon

@spydon spydon commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Adds admin.sign_out(jwt, scope="global") to both admin clients, restoring the v2 API. Closes SDK-2735.

  • Calls POST /logout with the user's access token and the scope.
  • Shares the request and the "already signed out" handling with the client sign_out.
  • Registers auth.admin.sign_out as implemented in sdk-compliance.yaml.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added admin sign-out for a session token, with global, local, and other-session scopes. Global sign-out is used by default.
    • Sign-out succeeds if the requested session or user is already signed out. Access tokens may remain valid until they expire.
  • Bug Fixes
    • Improved handling of sign-out errors: invalid scopes are rejected, while other API and server errors are reported.

The admin API now provides sign_out with global, local, and others scopes. It validates the scope and uses shared logout handling, which sends the request and processes already-signed-out responses. Client sign-out also uses this shared handling. Synchronous and asynchronous tests cover request behavior, errors, and refresh attempts after admin sign-out.

Sequence Diagram(s)

sequenceDiagram
  participant SupabaseAuthAdmin
  participant _logout
  participant LogoutEndpoint
  SupabaseAuthAdmin->>_logout: JWT and validated scope
  _logout->>LogoutEndpoint: POST with scope and bearer token
  LogoutEndpoint-->>_logout: Response
  _logout-->>SupabaseAuthAdmin: Return success or raise error
Loading

Possibly related PRs

Change: Feature

Merge Risk: Minimal · up to 22f6f

This adds an admin sign_out method that restores the v2 API and shares logout handling with client sign-out. No actionable merge-blocking risk was identified, and the new tests cover the main scope and error behavior.

- [ ] 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2db04064-1cc2-43f4-9029-b20e42b1c1a2
Commits

Reviewing files that changed from the base of the PR and between 3042be2 and 22f6fe2.

Files selected for processing: 3

  • src/auth/src/supabase_auth/admin_api.py
  • src/auth/tests/_async/test_gotrue_admin_api.py
  • src/auth/tests/_sync/test_gotrue_admin_api.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.

@spydon
spydon merged commit 0df6509 into main Nov 17, 2026
26 checks passed
@spydon
spydon deleted the lukasklingsbo/sdk-2735-auth-add-admin-sign-out branch November 17, 2026 09:47
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.

1 participant