Skip to content

feat(auth): logoutRedirect hook — sign out at the identity provider too - #74

Merged
dskripchenko merged 1 commit into
mainfrom
feat/logout-redirect
Oct 14, 2026
Merged

dskripchenko merged 1 commit into
mainfrom
feat/logout-redirect

Conversation

@dskripchenko

Copy link
Copy Markdown
Owner

A generic hook for RP-initiated logout (needed by laravel-admin-oidc).

  • Admin::logoutRedirect(callable) / Auth\LogoutRedirectRegistry: per-panel resolvers, run before the session is cleared; the first followable address (absolute http(s) or a path) wins, a throwing resolver is reported and skipped.
  • auth/logout answers with payload.redirect (null when nothing is registered — backward compatible).
  • SPA: auth.logout() returns the address; UserMenu follows it with window.location.assign, otherwise opens the login page as before.
  • Tests: PHP (session readable before clearing, unsafe addresses skipped, per panel) and vitest (store, menu click). Docs: integration.md ×4 languages.

🤖 Generated with Claude Code

Admin::logoutRedirect() registers per-panel resolvers of where the browser
goes after a sign-out. They run before the session is cleared, so an SSO
package can read the ID token it kept at sign-in. auth/logout answers with
payload.redirect, and the SPA follows it with a full navigation instead of
opening its own login page. Only absolute http(s) addresses and paths
are followed; a resolver that throws is reported and skipped.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dskripchenko
dskripchenko merged commit 374ceea into main Oct 14, 2026
12 checks passed
@dskripchenko
dskripchenko deleted the feat/logout-redirect branch October 14, 2026 12:07
@dskripchenko dskripchenko mentioned this pull request Oct 14, 2026
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