mirror of
https://github.com/marcogll/ap_pos.git
synced 2026-01-13 13:15:16 +00:00
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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user