diff options
| author | Adam Soltys <[email protected]> | 2023-03-11 10:20:46 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-03-11 10:20:46 -0800 |
| commit | 5955ff6969a5301c4413631b76cf2300d193f8ed (patch) | |
| tree | 92d1269a098cb7c764ca92f7a40af9ee236ae5b1 /routes/email.js | |
| parent | 7fec7cc3e7c51a9892869732b5bfe65922ee7818 (diff) | |
| download | coinos-server-5955ff6969a5301c4413631b76cf2300d193f8ed.tar.gz coinos-server-5955ff6969a5301c4413631b76cf2300d193f8ed.zip | |
separate tips from amounts
Diffstat (limited to 'routes/email.js')
| -rw-r--r-- | routes/email.js | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/routes/email.js b/routes/email.js index 9213cdd3..1b551864 100644 --- a/routes/email.js +++ b/routes/email.js @@ -6,16 +6,16 @@ import sendgrid from "@sendgrid/mail"; export default { async send({ body }, res) { let { token: response } = body; - let { recaptcha: secret } = config; - let { success } = await got + let { recaptcha: secret } = config; + let { success } = await got .post("https://www.google.com/recaptcha/api/siteverify", { form: { secret, - response - } + response, + }, }) .json(); - + if (success) { delete body.token; sendgrid.setApiKey(config.sendgrid); @@ -24,15 +24,13 @@ export default { from: "[email protected]", subject: body.subject || "Email Signup", text: JSON.stringify(body), - html: JSON.stringify(body) + html: JSON.stringify(body), }; - await sendgrid.send(msg); - res.send({ ok: true }); - - } - else { - bail(res, "failed captcha"); - } - } + await sendgrid.send(msg); + res.send({ ok: true }); + } else { + bail(res, "failed captcha"); + } + }, }; |
