K
Kinde2mo ago
nick22985

Specify a redirect_uri on login?

Is there a way i can specify dynamically if a user clicks 1 signin button after login in it will go to /dashboard/1 however if they click another one it will go to /dashboard/2 as a example i thought this may work looking at this but doesnt seem to work https://docs.kinde.com/design/customize-with-code/understand-page-design/#set-the-page-default-export-function
login({
authUrlParams: {
redirectUri: '/dashboard/2',
},
})
login({
authUrlParams: {
redirectUri: '/dashboard/2',
},
})
Kinde docs
Understand Kinde page customization
Comprehensive guide for understanding Kinde page customization including React templating, directory structure, route mapping, and server-rendered JavaScript implementation.
1 Reply
Nathaly Toledo
Nathaly Toledo2mo ago
Hi there, The custom design code controls the authentication pages themselves (like the login screen), not the redirect behavior after authentication completes. The actual post-login redirect is handled by Kinde's authentication flow using the post_login_redirect_url parameter that gets passed through. So, you will need to use something like this <LoginLink postLoginRedirectURL="/dashboard/1">Sign in to Dashboard 1</LoginLink> <LoginLink postLoginRedirectURL="/dashboard/2">Sign in to Dashboard 2</LoginLink> You can read the post_login_redirect_url value in your custom page code, but you still need to pass it via the SDK methods (like LoginLink with postLoginRedirectURL) or query parameters when initiating the login flow. The custom design code won't change where users land after authentication—that's controlled by the redirect URL you specify when starting the auth flow.

Did you find this page helpful?