fix: add missing two_factor.verified column required by plugin

The two-factor plugin reads/writes a verified boolean on the twoFactor
model (set true by verify-totp); without it the drizzle adapter rejects
every /two-factor/enable call.
This commit is contained in:
Leon Tonhäuser committed 2026-08-25 03:13:02 +02:00
1 parent 0d939593c8
commit f42f4d5d2d
4 files changed
+1952

No files matched your search

+3
View File
@@ -27,6 +27,9 @@ export const twoFactors = pgTable("two_factor", {
.references(() => users.id, { onDelete: "restrict" }),
secret: text("secret").notNull(),
backupCodes: text("backup_codes"),
// Set by Better Auth's verify-totp step; enable returns verified=false until
// the first valid TOTP code confirms possession of the authenticator.
verified: boolean("verified").notNull().default(false),
});
export const accounts = pgTable("account", {