You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
For additional context, the issue behaves slightly differently in the code for our app vs the repro. For starters in our code it occurs 100% of the time vs ~50% in the repro. Essentially, as soon as you hit sign out the client-side error occurs. It does not redirect to sign in or any other url provided to the sign out function callback. Using the signOut function vs SignOutButton etc. doesn't make a difference. When digging into middleware, what appears to be happening is that auth.protect() still seems to think the user is authenticated and does not redirect to sign in or, auth() still seems to be populated with the user's info / etc. But when getToken is called somewhere within the route it fails and causes the error (but that code should not be reachabale by a signed out user on a route that's "protected")
This did not occur in the previous 4.x version with authMiddleware that we were using before.
Hello @philefstat , we've pushed a fix with our latest release! You don't have to upgrade your packages as long as running Clerk.version in the browser console returns a version newer or equal to 5.4.0.
I'm closing this one, but please feel free to reopen if needed!
Preliminary Checks
Reproduction
https://github.com/philefstat/clerk-bug-repro
Publishable key
pk_test_c3BsZW5kaWQtY2hpZ2dlci00NS5jbGVyay5hY2NvdW50cy5kZXYk
Description
The repro above is simply the clerk nextjs started with the @clerk/nextjs version bumped to 5.0.7 and no other modifications.
Steps to reproduce:
Expected behavior:
User is signed out and redirected to login
Actual behavior:
Full page client-side error about 50% of the time
Environment
The text was updated successfully, but these errors were encountered: