Skip to content

feat: add redirectOptions.redirectOnSignOut to redirect an open page when the session ends - #656

Open
zlotnika wants to merge 1 commit into
nuxt-modules:mainfrom
zlotnika:redirect-on-sign-out
Open

zlotnika wants to merge 1 commit into
nuxt-modules:mainfrom
zlotnika:redirect-on-sign-out

Conversation

@zlotnika

Copy link
Copy Markdown
Contributor

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

The redirect middleware only runs on navigation, so when a session ends while a page is open (sign out, a revoked session, an expired refresh token) the page stays on screen and its requests start failing. redirectOptions.redirectOnSignOut: true re-runs the current route on SIGNED_OUT, so the existing middleware redirects to login, respects include/exclude, and saves the path when saveRedirectToCookie is on. Opt-in, client-only, default false.

The navigation isn't returned from the onAuthStateChange callback, because auth-js awaits callbacks while it holds its lock.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes: the existing tests are module-setup only, with no runtime plugin tests to extend.

🤖 Generated with Claude Code

…e when the session ends

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 19, 2026

Copy link
Copy Markdown

@zlotnika is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new

pkg-pr-new Bot commented Nov 19, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxtjs/supabase@656

commit: b09cd03

This branch has not been deployed

No deployments
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