feat: reestruturacao de menus na sidebar, niveis de acesso e migracao para postgresql/dragonflydb
continuous-integration/webhook Deploy concluido (rx.scoreodonto.com)

This commit is contained in:
VPS 4 Builder
2026-05-26 21:08:48 +02:00
parent dc1801f4a7
commit 5b0d80bf22
29 changed files with 257 additions and 7187 deletions
+2 -2
View File
@@ -83,7 +83,7 @@ function generateToken(user, expiresIn = JWT_EXPIRES_IN) {
async function createInitialUser() {
try {
// Verificar se usuário já existe
const existingUser = await db.get('SELECT * FROM users WHERE username = ?', ['rcesar']);
const existingUser = await db.get('SELECT * FROM users WHERE username = $1', ['rcesar']);
if (existingUser) {
console.log('👤 Usuário admin já existe:', existingUser.username);
@@ -96,7 +96,7 @@ async function createInitialUser() {
// Inserir usuário
await db.run(
`INSERT INTO users (username, email, password_hash, is_admin, created_at)
VALUES (?, ?, ?, 1, NOW())`,
VALUES ($1, $2, $3, true, CURRENT_TIMESTAMP) RETURNING id`,
['rcesar', 'rcesar@rcesar.com', passwordHash]
);