diff --git a/dental-server/dental-client/public/version.txt b/dental-server/dental-client/public/version.txt index 291d0de..2f1a5aa 100644 --- a/dental-server/dental-client/public/version.txt +++ b/dental-server/dental-client/public/version.txt @@ -1 +1 @@ -2.1.16 +2.1.17 diff --git a/dental-server/routes/system.js b/dental-server/routes/system.js index 391d17f..b139fb4 100644 --- a/dental-server/routes/system.js +++ b/dental-server/routes/system.js @@ -185,6 +185,10 @@ router.post('/storage-config', async (req, res) => { ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value, updated_at = NOW() `, [configJson]); + // 3. CRÍTICO: recarregar a config no processo em execução, senão o cliente S3 + // em memória continua usando as credenciais antigas (uploads falham com 403). + await storage.loadConfigFromDb(); + return res.json({ success: true, message: 'Configurações salvas com sucesso.' }); } catch (error) { console.error('Erro ao salvar storage-config:', error);