Middleware redirect not working

the path is returning the right path but it is not being rendered on the page
12 Replies
teaonrocks
teaonrocks2y ago
even though it is returning sign-in the page is rendering index bump
Neto
Neto2y ago
what is the config matcher?
James Perkins
James Perkins2y ago
first things i see if you are using /sign-in/[[…index]].tsx your public path needs to be /sign-in* to match anything on the route. because sign-in?redirect_url=x isn’t the same as sign-in
teaonrocks
teaonrocks2y ago
teaonrocks
teaonrocks2y ago
ill try that seems like its a problem with the matcher, but i cant figure out why. when i comment out the matcher the redirect works but the page is returning a blank white page @here sorry for the ping 🙏 seems like it works when i turn of the matcher but i think it isnt good for the middleware to be running through all the static files
James Perkins
James Perkins2y ago
try this from the clerk docs export const config = { matcher: [ /* * Match all request paths except for the ones starting with: * - _next * - static (static files) * - favicon.ico (favicon file) * - public folder / "/((?!static|.\..|_next|favicon.ico).)", "/", ], }
teaonrocks
teaonrocks2y ago
doesnt seem to work either this omits the index page of my app from having to run the middleware but the index page is actually not public
James Perkins
James Perkins2y ago
actually it’s the opposite it runs on middleware. Can you provide a repo to speed up the process
teaonrocks
teaonrocks2y ago
sure hold on
teaonrocks
teaonrocks2y ago
GitHub
GitHub - bentoodev/crm-grow
Contribute to bentoodev/crm-grow development by creating an account on GitHub.
James Perkins
James Perkins2y ago
cool i’ll look in a couple hours
teaonrocks
teaonrocks2y ago
currently the matcher is commented out which works but when i un comment the matcher index doesnt redirect to sign in if not authed thanks 🙏 really appreciate it for some reason in production the pages are returning a 404 https://crmgrow.bentoo.dev yeah i fixed the middleware thing but now im getting 404s in production
Want results from more Discord servers?
Add your server