Skip to content

Commit 246a4d1

Browse files
committed
fix(providers): allow optional identifier param
1 parent e0a7d71 commit 246a4d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/next-auth/src/core/routes/callback.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,14 @@ export default async function callback(params: {
202202
const paramToken = query?.token as string | undefined
203203
const paramIdentifier = query?.email as string | undefined
204204

205-
// If these are missing, the sign-in URL was manually opened without these params or the `sendVerificationRequest` method did not send the link correctly in the email.
206-
if (!paramToken || !paramIdentifier) {
205+
// If token is missing, the sign-in URL was manually opened without this param or the `sendVerificationRequest` method did not send the link correctly in the email.
206+
if (!paramToken) {
207207
return { redirect: `${url}/error?error=configuration`, cookies }
208208
}
209209

210210
// @ts-expect-error -- Verified in `assertConfig`. adapter: Adapter<true>
211211
const invite = await adapter.useVerificationToken({
212+
// @ts-expect-error User-land adapters might decide to omit the identifier during lookup
212213
identifier: paramIdentifier,
213214
token: hashToken(paramToken, options),
214215
})

0 commit comments

Comments
 (0)