From 51888208a2d86d57d8464a2e0c64f98f8096c0e1 Mon Sep 17 00:00:00 2001 From: Francis Li Date: Sun, 25 Aug 2024 14:16:46 -0700 Subject: [PATCH] Fix formatting --- server/helpers/email/mailer.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/helpers/email/mailer.js b/server/helpers/email/mailer.js index 1fff15de..0d5736e6 100644 --- a/server/helpers/email/mailer.js +++ b/server/helpers/email/mailer.js @@ -14,8 +14,16 @@ if (process.env.AWS_SES_REGION) { const message = 'SendRawEmail'; const version = 4; let signature; - signature = crypto.createHmac('sha256', `AWS4${process.env.AWS_SES_SECRET_ACCESS_KEY}`, { encoding: 'utf8' }).update(date).digest(); - signature = crypto.createHmac('sha256', signature).update(process.env.AWS_SES_REGION).digest(); + signature = crypto + .createHmac('sha256', `AWS4${process.env.AWS_SES_SECRET_ACCESS_KEY}`, { + encoding: 'utf8', + }) + .update(date) + .digest(); + signature = crypto + .createHmac('sha256', signature) + .update(process.env.AWS_SES_REGION) + .digest(); signature = crypto.createHmac('sha256', signature).update(service).digest(); signature = crypto.createHmac('sha256', signature).update(terminal).digest(); signature = crypto.createHmac('sha256', signature).update(message).digest();