diff options
author | 2022-05-29 17:45:54 +0100 | |
---|---|---|
committer | 2022-05-29 17:45:54 +0100 | |
commit | 308d07785f811ff470d0e90b11680926a823027b (patch) | |
tree | 7afe7859fc29f6a5c34be8b7b486cc317cc82e21 /pages/api/verify.js | |
parent | 50d781d0bdcac217f2bc037abe087a00019edba5 (diff) | |
download | my_apps-308d07785f811ff470d0e90b11680926a823027b.tar.gz my_apps-308d07785f811ff470d0e90b11680926a823027b.tar.bz2 my_apps-308d07785f811ff470d0e90b11680926a823027b.zip |
add change password option
Diffstat (limited to 'pages/api/verify.js')
-rw-r--r-- | pages/api/verify.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pages/api/verify.js b/pages/api/verify.js index 89bd4cd..edcc7a9 100644 --- a/pages/api/verify.js +++ b/pages/api/verify.js @@ -2,7 +2,7 @@ import dbConnect from 'configs/dbConnect' import sendMail from 'configs/sendMail' import User from 'models/User' import withSession from 'hocs/withSession' -import { subject, text, html } from 'helpers/email' +import mailData from 'helpers/email' export default withSession(async (req, res) => { await dbConnect() @@ -16,7 +16,7 @@ export default withSession(async (req, res) => { const key = await User.getVerificationKey(email) if (!key) { throw new Error('Something went wrong') } - const response = await sendMail(email, subject(l), text(l, key), html(l, key)) + const response = await sendMail({to: email, ...mailData('v', l, key)}) if (!response?.accepted?.length) { throw new Error('Something went wrong') } res.status(204).send() |