KindeK
Kinde12mo ago
6 replies
Anh Thư

error fetch failed when logging in

Hi everyone,
I am new to Kinde and currently stuck at the very first stage for login. I followed every step in the Quick start in my Nextjs project, I also changed the Allowed logout redirect URLs to match with the url in .env.local. Specifically I am following a tutorial on youtube and in the tutorial it worked properly.

My problem is that after signing in, it doesn’t redirect to the post login url as expected but show this error: fetch failed, even though as I checked in network tab and on Kinde, user logged in successfully.

What I had tried:
- Deleted cache, deleted business and created new one
- Replace app/api/auth/[kindeAuth]/route.js with this:
import {handleAuth} from "@kinde-oss/kinde-auth-nextjs/server";

export async function GET(request, {params}) {
    const endpoint = params.kindeAuth;
    return await handleAuth(request, endpoint);
}

- Add this to Sentry config
export default withSentryConfig(config, {
  excludeServerRoutes: [new RegExp('/api/auth/.*')],
});


I haven’t added middleware or deployed on Vercel yet. I am using Nextjs 15.1.6 and Kinde 2.5.0
SCR-20250211-suzw.png
SCR-20250211-svbj.png
Was this page helpful?