when im on my protected route and i
when im on my protected route and i signout. the middleware would redirect me to auth page however the url will still say dashboard and things r rendered incorrectly like a bugged rewrite or smth
9 Replies
Show me your middleware.ts?
And the sign out function you have
I'm not seeing a problem here, but it happened with me alot because of the "replace state" in the redirect, should you worry about it? Not really
GitHub
convex-auth/src/nextjs/server/index.tsx at 27342257398180aa5111b05a...
Library for built-in auth. Contribute to get-convex/convex-auth development by creating an account on GitHub.
I mean i should worry about it in my app cuz what happens breaks my layout render
I have two separate routr groups, protected and public
When i get redirected and url still says /dashboard
It messss things up and some comps still render even tho they shouldn't
Its like as if a client rewrite is happening and not a full server redirect
Ai suggested i use router.replace on client after signout but that made things flash and kinda not instant and i would see 2 requests
Then force change it on your end, instead of returning a redirect from convrx, write your own
In middleware?
Changing the history? That might work but not really with the middle
Yes.
How would we do so?