Skip to content

Commit

Permalink
fix: web-hook-url
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelB committed Jun 3, 2020
1 parent 7bb7c8f commit 7ba222a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pages/api/webhooks/account.js
Expand Up @@ -7,6 +7,8 @@ const BASE_URL =
export default async function accountWebhook(req, res) {
const apiError = createErrorFor(res);

console.log("[webhook] start webhook");

if (req.headers["email-secret"] !== process.env.ACCOUNT_EMAIL_SECRET) {
return apiError(Boom.unauthorized("Invalid secret token"));
}
Expand Down Expand Up @@ -79,6 +81,7 @@ L'equipe veille CDTN
};
try {
const results = await sendmail(mailOptions);
console.log("[webhook] email send", op);
res.json(results);
} catch (error) {
console.error(error);
Expand Down

0 comments on commit 7ba222a

Please sign in to comment.