-
Hi Jack, where is the login route coming from? I'm trying to change the on success handler on the login page to redirect to a different page, but I can't follow whats happening in the direct flow. Where can I change the redirect router? thank you
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hey @MincePie, so on the login page there's a withNoAuth wrapper around it, which basically just checks if there is a user present and redirects away. React.useEffect(() => {
if (loading || !me) return
router.replace(redirectUrl || redirect || "/")
}, [loading, me, router, redirect]) I think to change the redirect location you may need to just change: in the login page: - router.replace(redirect || "/")
+ router.replace(redirect || "/dashboard") and in the withNoAuth component: - router.replace(redirectUrl || redirect || "/")
+ router.replace(redirectUrl || redirect || "/dashboard") |
Beta Was this translation helpful? Give feedback.
-
It's strange, because when I try that, the login success redirect just goes to the / url. I can change the redirect on the navbar to make a home link that goes to dashboard and the page loads correctly, but when I use the login flow, I get a url that limits to localhost3000/ and uses the content that is rendered through the dashboard frame, but not inside the dashboard layout. I'll keep looking for what might be forcing that. Thanks very much again |
Beta Was this translation helpful? Give feedback.
-
I prove myself a fool every time I ask you a question. I had a stray redirect on the home page that was interfering with your flow. Thank you again. I'll check twice before I ask next time. |
Beta Was this translation helpful? Give feedback.
It's strange, because when I try that, the login success redirect just goes to the / url.
I can change the redirect on the navbar to make a home link that goes to dashboard and the page loads correctly, but when I use the login flow, I get a url that limits to localhost3000/ and uses the content that is rendered through the dashboard frame, but not inside the dashboard layout. I'll keep looking for what might be forcing that. Thanks very much again