Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/authjs-nuxt/src/runtime/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ export async function signIn<P extends RedirectableProviderType | undefined = un

const response = await postToInternal({ url: _signInUrl, options, callbackUrl })
const url = response?._data?.url ?? null
const error = url ? new URL(url).searchParams.get("error") : null
const searchParams = url ? new URL(url).searchParams : null
const error = searchParams?.get("code") ?? searchParams?.get("error") ?? null
if (error) throw new Error(error)
if (isCredentials && !redirect) reloadNuxtApp({ persistState: true, force: true })
if (redirect || !isSupportingReturn) {
Expand Down