K
Kinde5mo ago
ali97

Redirected to a page displaying null after login

I have recently migrated our startup from using clerkJs to kinde auth. I have integrated all of the parts but there seems to be an issue after login. After successfully logging in a page is shown with the message null. If I retype my website's url the authentication has indeed worked fine. I guess there is a problem with the redirect but I have set up the redirect paths as the docs suggested. What else seems to be the problem?
3 Replies
onderay
onderay5mo ago
Sorry to hear you have hit an issue @ali97. What Kinde SDK are you using?
ali97
ali975mo ago
Next js
onderay
onderay5mo ago
It sounds like you've done the right steps in setting up the redirect paths. However, there might be a few things you could check: Make sure that the KINDE_POST_LOGIN_REDIRECT_URL environment variable is correctly set in your .env.local file. This should be the URL where you want users to be redirected to after authenticating. Check if the postLoginRedirectURL parameter is correctly set in the <LoginLink> and <RegisterLink> components. This parameter tells Kinde where to redirect after authenticating. Ensure that the value of post_login_redirect_url is either a URL on the same origin or a relative path. Make sure that the callback URLs and logout redirect URLs are correctly added to your app in Kinde. If you're using dynamic redirect URLs, ensure that the next.config.js file is correctly configured. If you've checked all these and the issue still persists, let me know and I get our NextJS expert on the case Also make sure you dont have an trailing slashs on your callback URLs