fix: update database queries to use 'active' instead of 'is_active' for consistency

This commit is contained in:
Giuseppe Raffa
2026-04-16 00:18:49 +02:00
parent 370f911063
commit c0be21a718
2 changed files with 4 additions and 4 deletions

View File

@@ -33,7 +33,7 @@ async function register(username, password) {
* Esegue il login di un utente
*/
async function login(username, password) {
const result = await query('SELECT id, username, password_hash, is_active, created_at FROM users WHERE username = $1', [username]);
const result = await query('SELECT id, username, password_hash, active, created_at FROM users WHERE username = $1', [username]);
if (result.rows.length === 0) {
throw new Error('No user matched')
}
@@ -105,7 +105,7 @@ async function validateSession(token) {
throw new Error('Session user mismatch');
}
if (!session.is_active) {
if (!session.active) {
throw new Error('Session is not active');
}
}