Skip to content

Email Verfication MicroService - #40

Merged
Siddharth-732 merged 7 commits into
mainfrom
feat/verify-otp
Jul 2, 2026
Merged

Email Verfication MicroService#40
Siddharth-732 merged 7 commits into
mainfrom
feat/verify-otp

Conversation

@Siddharth-732

Copy link
Copy Markdown
Owner

Closes #21

Copilot AI review requested due to automatic review settings July 2, 2026 08:24
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pulse-chat-a1a4 Ready Ready Preview, Comment Jul 2, 2026 9:32am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Implements an OTP-based email verification flow during user registration, backed by Redis + BullMQ and delivered via the existing email worker. This aligns registration with Issue #21’s goal of validating emails before account creation.

Changes:

  • Added backend /users/send-otp and /users/verify-otp endpoints and required an emailVerificationToken for /users/register.
  • Updated the frontend registration flow to a 3-step process (basic info → OTP verify → profile completion).
  • Updated the email service worker/templates to send OTP emails and a post-registration welcome email.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
frontend/app/register/page.tsx Adds a 3-step registration UI with OTP send/verify and passes emailVerificationToken to registration.
backend/src/controllers/user.controllers.js Implements OTP send/verify, enforces email verification token during registration, and queues welcome email.
backend/src/routes/user.routes.js Exposes new OTP endpoints and refactors one route definition for consistency.
backend/src/utils/emailQueue.js Exports a shared Redis client and updates BullMQ queue connection usage.
email-service/src/workers/emailWorker.js Adds handling for send-otp and send-welcome jobs.
email-service/src/templates/otpTemplate.js Introduces the OTP email HTML template.
email-service/src/templates/welcomeTemplate.js Introduces the welcome email HTML template.
email-service/src/templates/verificationTemplate.js Removes the old link-based verification email template.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/src/controllers/user.controllers.js Outdated
Comment on lines +101 to +110
// Decode the temporary token and verify it belongs to this email
const decoded = jwt.verify(
emailVerificationToken,
process.env.ACCESS_TOKEN_SECRET,
);
if (decoded.email !== email) {
return res
.status(400)
.json({ message: "Invalid verification token for this email." });
}
Comment thread backend/src/utils/emailQueue.js
Comment thread email-service/src/templates/welcomeTemplate.js
Comment thread backend/src/controllers/user.controllers.js
@Siddharth-732
Siddharth-732 merged commit cae9b4a into main Jul 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ISSUE 10 ! Email Verification Flow

2 participants