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
import{clerkMiddleware,createRouteMatcher}from"@clerk/nextjs/server";constisPublicRoute=createRouteMatcher(['/sign-in(.*)','/sign-up(.*)']);exportdefaultclerkMiddleware((auth,req)=>{if(!auth().userId&&!isPublicRoute(req)){// Add custom logic to run before redirectingreturnauth().redirectToSignIn();}});exportconstconfig={matcher: [// Skip Next.js internals and all static files, unless found in search params'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',// Always run for API routes'/(api|trpc)(.*)',],};
When I logout, it redirects to the sign-in page, but the sign-in component does not render. Initially, it renders when I go to /sign-in.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I have some issues in my app after logout. I am using Next.js with Clerk, and I will explain the details below:
.env.local:
Dependencies:
middleware.ts:
When I logout, it redirects to the sign-in page, but the sign-in component does not render. Initially, it renders when I go to
/sign-in
.Beta Was this translation helpful? Give feedback.
All reactions