From 5b2acd7d9761eb34431dc2b10348fbf69ba41b94 Mon Sep 17 00:00:00 2001 From: DiegoVictor Date: Wed, 10 Jul 2024 18:52:15 -0300 Subject: [PATCH] Encode password --- src/infra/database/manager.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/infra/database/manager.js b/src/infra/database/manager.js index b89fab7..e5c92ee 100644 --- a/src/infra/database/manager.js +++ b/src/infra/database/manager.js @@ -14,9 +14,11 @@ const manager = { } const { username, password } = await secretManager.getSecret( - process.env.CLUSTER_SECRET_ID + env.CLUSTER_SECRET_ID ); - return `postgresql://${username}:${password}@${process.env.CLUSTER_URL}/coderunner?schema=public`; + const encoded = encodeURIComponent(password); + + return `postgresql://${username}:${encoded}@${env.CLUSTER_URL}/coderunner?schema=public`; }, connect: async () => { if (!manager.client) {