The oauth callback url with state and code

I deploy the better-auth Official demo (better-auth/demo/nextjs at main · better-auth/better-auth · GitHub), setup env. I try google oauth signin. Current behavior: login successfully however the callback url with params, like “/domain?state=…2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+openid&authuser=0&prompt=none”
I also try the vercel, that’s no problem.

netlify platform

vercel platform

Thanks for your time

Netlify preserves query params when redirecting. You must redirect to a new URL without query like: /?login=true OR use an Edge Function to remove the query:

export default async function() {
  return new Response(null, {
    headers: {
      location: 'https://www.google.com/'
    },
    status: 301
  })
}

export const config = {
  path: '/redirect'
}