From b59eae1641410cfd511bb70e4045ee25eb5e7830 Mon Sep 17 00:00:00 2001 From: VPS 4 Deploy Agent Date: Sat, 30 May 2026 19:03:30 +0200 Subject: [PATCH] =?UTF-8?q?fix(wasabi):=20reload=20S3=20client=20after=20s?= =?UTF-8?q?aving=20credentials=20(403=20persistia=20com=20chave=20antiga?= =?UTF-8?q?=20em=20mem=C3=B3ria)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dental-server/dental-client/public/version.txt | 2 +- dental-server/routes/system.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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);