diff --git a/packages/next-auth/src/react.tsx b/packages/next-auth/src/react.tsx index f6405ffe87..62d5ebc0ff 100644 --- a/packages/next-auth/src/react.tsx +++ b/packages/next-auth/src/react.tsx @@ -278,7 +278,7 @@ export async function signIn< return } - const error = new URL(data.url).searchParams.get("error") + const error = new URL(data.url, baseUrl).searchParams.get("error") if (res.ok) { await __NEXTAUTH._getSession({ event: "storage" })