// Moderation tests act as people with two-factor sign-in on (sensitive permissions need it); two-factor.test.ts tests // the sign-in itself. import { eq, schema, type Database } from "@t5de/db"; /** Turns two-factor sign-in on for an account, as if they'd set it up. Signing in again would then ask for a code. */ export const twoFactorOn = (db: Database, username: string) => db.update(schema.user).set({ twoFactorEnabled: true }).where(eq(schema.user.username, username.toLowerCase()));