Middleware redirect not working
the path is returning the right path but it is not being rendered on the page
12 Replies
even though it is returning sign-in the page is rendering index
bump
what is the config matcher?
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
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
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).)",
"/",
],
}
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
actually it’s the opposite it runs on middleware.
Can you provide a repo to speed up the process
sure hold on
GitHub
GitHub - bentoodev/crm-grow
Contribute to bentoodev/crm-grow development by creating an account on GitHub.
cool i’ll look in a couple hours
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