Amélioration 2FA
This commit is contained in:
@@ -1775,6 +1775,20 @@ db.exec(`
|
||||
db.exec('CREATE INDEX IF NOT EXISTS idx_2fa_dev_token ON two_fa_trusted_devices(token)');
|
||||
db.exec('CREATE INDEX IF NOT EXISTS idx_2fa_dev_uid ON two_fa_trusted_devices(user_id)');
|
||||
|
||||
|
||||
// ── Migration : user_agent + ip_address sur two_fa_trusted_devices ───────────
|
||||
{
|
||||
const devCols = db.prepare('PRAGMA table_info(two_fa_trusted_devices)').all().map(c => c.name);
|
||||
if (!devCols.includes('user_agent')) {
|
||||
db.exec('ALTER TABLE two_fa_trusted_devices ADD COLUMN user_agent TEXT');
|
||||
console.log('[DB] two_fa_trusted_devices.user_agent ajouté');
|
||||
}
|
||||
if (!devCols.includes('ip_address')) {
|
||||
db.exec('ALTER TABLE two_fa_trusted_devices ADD COLUMN ip_address TEXT');
|
||||
console.log('[DB] two_fa_trusted_devices.ip_address ajouté');
|
||||
}
|
||||
}
|
||||
|
||||
console.log('[DB] Migrations 2FA OK');
|
||||
|
||||
export default db;
|
||||
|
||||
Reference in New Issue
Block a user