fix(auth): require verified OIDC email for linking

This commit is contained in:
ajnart committed 2026-07-22 23:00:34 +02:00
1 parent 00a65bfc58
commit 181850f77f
5 files changed
+37 -2

No files matched your search

+3
View File
@@ -35,6 +35,9 @@ export const createAdapter = (
});
if (!user && provider === "oidc" && enableDangerousCredentialsLinking) {
// Credentials accounts do not have an email-verification flow, so their
// Auth.js emailVerified field is always null. The OIDC profile's strict
// email_verified check is the security boundary for this opt-in.
user = await db.query.users.findFirst({
where: and(eq(users.email, email), eq(users.provider, "credentials")),
columns: {