diff --git a/server/data/chatter.js b/server/data/chatter.js index 24173a872..e610f9791 100644 --- a/server/data/chatter.js +++ b/server/data/chatter.js @@ -160,7 +160,8 @@ async function getPrivateKey() { try { const { SecretString, SecretBinary } = await client.send(command); if (SecretString || SecretBinary) logger.log("chatter-retrieved-private-key", "DEBUG", "api", null, null); - return SecretString || Buffer.from(SecretBinary, "base64").toString("ascii"); + const chatterPrivateKey = SecretString ? JSON.parse(SecretString) : JSON.parse(Buffer.from(SecretBinary, "base64").toString("ascii")); + return chatterPrivateKey.private_key; } catch (error) { logger.log("chatter-get-private-key", "ERROR", "api", null, error); throw err;