Skip to content

Commit 3e8a648

Browse files
committed
fix(providers): make identifier param optional
1 parent 54ba689 commit 3e8a648

File tree

1 file changed

+5
-4
lines changed
  • packages/core/src/lib/actions/callback

1 file changed

+5
-4
lines changed

packages/core/src/lib/actions/callback/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ export async function callback(
201201
const paramToken = query?.token as string | undefined
202202
const paramIdentifier = query?.email as string | undefined
203203

204-
if (!paramToken || !paramIdentifier) {
204+
if (!paramToken) {
205205
const e = new TypeError(
206-
"Missing token or email. The sign-in URL was manually opened without token/identifier or the link was not sent correctly in the email.",
207-
{ cause: { hasToken: !!paramToken, hasEmail: !!paramIdentifier } }
206+
"Missing token. The sign-in URL was manually opened without token or the link was not sent correctly in the email.",
207+
{ cause: { hasToken: !!paramToken } }
208208
)
209209
e.name = "Configuration"
210210
throw e
@@ -213,7 +213,8 @@ export async function callback(
213213
const secret = provider.secret ?? options.secret
214214
// @ts-expect-error -- Verified in `assertConfig`.
215215
const invite = await adapter.useVerificationToken({
216-
identifier: paramIdentifier, // TODO: Drop this requirement for lookup
216+
// @ts-expect-error User-land adapters might decide to omit the identifier during lookup
217+
identifier: paramIdentifier, // TODO: Drop this requirement for lookup in official adapters too
217218
token: await createHash(`${paramToken}${secret}`),
218219
})
219220

0 commit comments

Comments
 (0)