Next.js Discord

Discord Forum

Weird issue when redirecting on client side related to cookies

Unanswered
Oriental Scops-Owl posted this in #help-forum
Open in Discord
Oriental Scops-OwlOP
Hi i have a client side register component that has a register form for my site. after registering an account, the api returns a user access/refresh token cookie, the cookie gets set on the server-side via Nextjs action. after this completes, the client front end gets redirected to '/dashboard' with router.push() .

I have an underlying auth provider that checks if the cookie is set on the server-side. when the user gets redirected to /dashboard the guard i have in place redirects the user back home (it does not see the cookie immediately)

was trying to see if anyone had any tips on how to fix this ?

0 Replies