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
Drop support for `next@13` and `next@14` since they have reached [EOL](https://nextjs.org/support-policy#unsupported-versions). Now `>= [email protected]` is required.
constdeprecationWarning=`Clerk:\nYour current Next.js version (${nextPackage.version}) will be deprecated in the next major release of "@clerk/nextjs". Please upgrade to [email protected] or later.`;
// ATTENTION: Avoid using wrapping code with `startTransition` on versions >= 14
93
-
// otherwise the fetcher of `useReverification()` will be pending indefinitely when called within `startTransition`.
94
-
if(nextVersion.startsWith('13')){
95
-
startTransition(()=>{
96
-
router.refresh();
97
-
});
98
-
}
99
-
// On Next.js v15 calling a server action that returns a 404 error when deployed on Vercel is prohibited, failing with 405 status code.
100
-
// When a user transitions from "signed in" to "singed out", we clear the `__session` cookie, then we call `__unstable__onBeforeSetActive`.
70
+
// On Next.js 15+ calling a server action that returns a 404 error when deployed on Vercel is prohibited, failing with 405 status code.
71
+
// When a user transitions from "signed in" to "signed out", we clear the `__session` cookie, then we call `__unstable__onBeforeSetActive`.
101
72
// If we were to call `invalidateCacheAction` while the user is already signed out (deleted cookie), any page protected by `auth.protect()`
102
73
// will result to the server action returning a 404 error (this happens because server actions inherit the protection rules of the page they are called from).
103
74
// SOLUTION:
104
75
// To mitigate this, since the router cache on version 15 is much less aggressive, we can treat this as a noop and simply resolve the promise.
105
76
// Once `setActive` performs the navigation, `__unstable__onAfterSetActive` will kick in and perform a router.refresh ensuring shared layouts will also update with the correct authentication context.
0 commit comments