Skip to content
pdmakwana2010Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AuthFlow – Automated Welcome Emails with Nodemailer

Extends (JWT Auth) to send a personalized HTML welcome email on every successful signup.

What's New in AuthFlow

File Change
backend/utils/mailer.js NEW — Nodemailer transporter + sendWelcomeEmail() + HTML template
backend/controllers/authController.js Calls sendWelcomeEmail() after user saved; email failure never crashes signup
backend/package.json Added nodemailer dependency
backend/.env Added MAIL_HOST, MAIL_PORT, MAIL_SECURE, MAIL_USER, MAIL_PASS

Setup

1. Configure MongoDB (same as jwt auth)

Update MONGO_URI in backend/.env with your Atlas connection string.

2. Configure Email

OPTION A — Ethereal (free fake SMTP, no real emails, best for testing):

  1. Go to https://ethereal.email → click "Create Ethereal Account"
  2. Copy the credentials into .env: MAIL_HOST=smtp.ethereal.email MAIL_PORT=587 MAIL_SECURE=false MAIL_USER=xxxxx@ethereal.email MAIL_PASS=xxxxxxxxxxxx After signup, terminal prints a Preview URL to see the email in browser.

OPTION B — Gmail (sends real emails):

  1. Enable 2-Factor Auth on Google account
  2. Google Account → Security → App Passwords → generate one
  3. Use the 16-char app password (not your real Gmail password): MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_SECURE=false MAIL_USER=yourgmail@gmail.com MAIL_PASS=abcd efgh ijkl mnop

3. Run Backend

cd AuthFlow/backend npm install npm run dev

4. Run Frontend (second terminal)

cd AuthFlow/frontend npm install npm run dev

Open http://localhost:5173

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages