Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates verify-email to HTTP method GET #254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/routes/v1/auth.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/services/email.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KeenWarrior , I think it will be front-end url. frontend will call the api accordingly. so no changes required.

const text = `Dear user,
To verify your email, click on this link: ${verificationEmailUrl}
If you did not create an account, then ignore this email.`;
Expand Down