fix(auth): ensure data persistence and correct login

- Corrected the client table rendering function to prevent UI breaking.
- Fixed a critical issue where data was not persisting in the local environment by ensuring an absolute path for the database.
- Implemented a temporary password reset mechanism to regain access and then removed it.
- Ensured client data is re-fetched from the server after saving to maintain UI consistency.
This commit is contained in:
Marco Gallegos
2025-08-13 09:55:32 -06:00
parent 2adba24312
commit 0cbabc8da4
3 changed files with 8 additions and 13 deletions

View File

@@ -23,7 +23,8 @@ app.use(session({
}));
// --- DATABASE INITIALIZATION ---
const dbPath = process.env.DB_PATH || './ap-pos.db';
// Usar un path absoluto para asegurar que la DB siempre se cree en la carpeta del proyecto.
const dbPath = path.join(__dirname, 'ap-pos.db');
console.log(`Connecting to database at: ${dbPath}`);
const db = new sqlite3.Database(dbPath, (err) => {