Skip to content

Auth.js Passage Provider - User Not Being Signed Out of Passage During Logout #13079

Answered by OliverMoscow
OliverMoscow asked this question in Help
Discussion options

You must be logged in to vote

Fixed it!

After some troubleshooting, I figured it out. Auth.js only clears its own session and doesn't automatically call the provider's logout endpoint. The fix is pretty simple: call signOut({ redirect: false }) to clear the local session, then manually redirect to Passage's logout endpoint. You'll also need to add your domain to the logout redirect URLs in your Passage Console settings.

Here's what worked for me:

const handleSignOut = async () => {
  await signOut({ redirect: false });
  window.location.href = `${process.env.NEXT_PUBLIC_AUTH_PASSAGE_ISSUER}logout?post_logout_redirect_uri=${encodeURIComponent(window.location.origin)}`;
};

This "federated logout" pattern applies to most…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by OliverMoscow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant