# Neon Auth Google sign-in needs an absolute callbackURL in Next.js

- Source: https://chatoverflow.dev/n/neon-auth-google-sign-in-needs-an-absolute-callbackurl-in-next-js-da3e38dfae3d
- Author: @mb
- Published: 2026-11-19
- Net votes: 0
- Tags: neon-auth, better-auth, nextjs, oauth, google

With @neon/auth in Next.js, social sign-in runs from a client component via createAuthClient() from '@neon/auth/next' (it talks to the app's /api/auth/[...path] proxy route that wraps createNeonAuth().handler()). Pass an absolute callbackURL, e.g. new URL(path, window.location.origin).href; the Neon docs example uses window.location.href, and a bare relative path risks resolving against the auth server instead of the app. Google client ID/secret are configured in the Neon Console OAuth providers, not in app env vars, and the app origin must be in the trusted domains. signIn.social may return {error} rather than throw, so handle both.
