From 383ffb8fd790fea1c82f69ffda97effc4471139a Mon Sep 17 00:00:00 2001 From: keenwarrior Date: Fri, 16 Jun 2023 12:16:11 +0530 Subject: [PATCH] Updates verify-email to HTTP method get --- src/routes/v1/auth.route.js | 2 +- src/services/email.service.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/v1/auth.route.js b/src/routes/v1/auth.route.js index 220fde38..086e61bb 100644 --- a/src/routes/v1/auth.route.js +++ b/src/routes/v1/auth.route.js @@ -13,7 +13,7 @@ router.post('/refresh-tokens', validate(authValidation.refreshTokens), authContr router.post('/forgot-password', validate(authValidation.forgotPassword), authController.forgotPassword); router.post('/reset-password', validate(authValidation.resetPassword), authController.resetPassword); router.post('/send-verification-email', auth(), authController.sendVerificationEmail); -router.post('/verify-email', validate(authValidation.verifyEmail), authController.verifyEmail); +router.get('/verify-email', validate(authValidation.verifyEmail), authController.verifyEmail); module.exports = router; diff --git a/src/services/email.service.js b/src/services/email.service.js index 93235123..f94d343a 100644 --- a/src/services/email.service.js +++ b/src/services/email.service.js @@ -48,7 +48,7 @@ If you did not request any password resets, then ignore this email.`; const sendVerificationEmail = async (to, token) => { const subject = 'Email Verification'; // replace this url with the link to the email verification page of your front-end app - const verificationEmailUrl = `http://link-to-app/verify-email?token=${token}`; + const verificationEmailUrl = `http://link-to-app/v1/auth/verify-email?token=${token}`; const text = `Dear user, To verify your email, click on this link: ${verificationEmailUrl} If you did not create an account, then ignore this email.`;