Implement email verification lockout and missing phase 2 items

This commit is contained in:
Mohan Ki
2026-07-27 19:55:19 +05:30
parent 2bfa741a71
commit 542426a12a
14 changed files with 980 additions and 210 deletions
+31
View File
@@ -0,0 +1,31 @@
const { Pool } = require('pg');
const pool = new Pool({host: 'localhost', port: 5432, user: 'postgres', password: 'password123', database: 'ckqr'});
async function run() {
try {
await pool.query(`
CREATE TABLE IF NOT EXISTS app_settings (
key VARCHAR(255) PRIMARY KEY,
value TEXT,
category VARCHAR(50),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
`);
console.log('Created app_settings table.');
await pool.query(`
INSERT INTO app_settings (key, value, category) VALUES
('smtp_host', 'smtp.office365.com', 'smtp'),
('smtp_port', '587', 'smtp'),
('smtp_user', 'noreply@cavininfotech.com', 'smtp'),
('smtp_pass', 'xmkshjlszjbkcyzb', 'smtp'),
('smtp_secure', 'false', 'smtp')
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value;
`);
console.log('Inserted SMTP settings.');
} catch (err) {
console.error(err);
} finally {
process.exit(0);
}
}
run();