fix: update database queries to use 'active' instead of 'is_active' for consistency
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user