Skip to content

Conversation

@Aishu9Para
Copy link

@Aishu9Para Aishu9Para commented Feb 12, 2026

📌 Linked Issue


🛠 Changes Made

  • Added: Gmail domain validation in frontend (Register.jsx) to restrict email registration to @gmail.com
  • Added: Backend validation in userController.js to enforce Gmail-only registration for security
  • Fixed: Issue where users could register with any @*.com email
  • Updated: Error handling to display clear message when non-Gmail address is used

🧪 Testing

  • Ran unit tests (npm test)

  • Tested manually (describe below):

    • Test case 1: Entered test@yahoo.com → Expected: Error message "Only Gmail addresses are allowed." → Result: Validation blocked successfully.

    • Test case 2: Entered test@gmail.com → Expected: Account created successfully → Result: Registration successful.

    • Test case 3: Entered TEST@GMAIL.COM → Expected: Registration allowed (case-insensitive check) → Result: Successful.


📸 UI Changes (if applicable)

Before After
Allowed registration with any email domain Restricts registration to Gmail addresses with proper error message

📝 Documentation Updates

  • Updated README/docs
  • Added code comments explaining validation logic

✅ Checklist

  • Created a new branch for PR
  • Have starred the repository
  • Follows JavaScript Styleguide
  • No console warnings/errors
  • Commit messages follow Git Guidelines

💡 Additional Notes (If any)

Frontend validation prevents invalid submissions, while backend validation ensures security against API-level bypass attempts.
This ensures consistent and secure enforcement of Gmail-only registration.

@netlify
Copy link

netlify bot commented Feb 12, 2026

Deploy Preview for smartrentsystem ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a9247f7
🔍 Latest deploy log https://app.netlify.com/projects/smartrentsystem/deploys/698d8d555f67b000083b1177
😎 Deploy Preview https://deploy-preview-174--smartrentsystem.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

1 participant