Team Menu Makers – Feedback Needed on Our Login System (Security + UX Best Practices) #181060
Replies: 7 comments 4 replies
-
Hi Team Menu Makers 👋 🔐 Security bcrypt → Argon2id is a good upgrade since it’s more resistant to GPU-based cracking. Store refresh tokens in HTTP-only Secure cookies and use token rotation with server-side invalidation. Add IP rate limiting + short temporary lockouts for repeated failures. Avoid long lockouts to prevent DoS issues. Store secrets in a secured vault (AWS Secrets Manager, Vault, Doppler) instead of plain .env in production. 🏗️ Architecture Keeping auth inside the main backend is fine at this stage. A microservice only makes sense if your app grows significantly. Suggested structure: src/ 🎨 UX A password strength meter (zxcvbn) is a simple improvement. 2FA (TOTP) is a great addition if time allows — it’s realistic and easy to justify. Keep the login UI minimal: clear error messages, “show password” toggle, and simple flows. Overall, you’re on the right path. These adjustments will help elevate your system closer to real-world production standards. Let me know if you'd like help formatting this further or adapting it to your team’s documentation. |
BetaWas this translation helpful?Give feedback.
-
Looks great so far! One additional tip: |
BetaWas this translation helpful?Give feedback.
-
From a UX point of view, here are suggestions: • Add a password strength indicator — users understand instantly how secure their chosen password is. • Provide show/hide password toggle to reduce login frustration. • Error messages should: ◦ avoid revealing details (“incorrect email or password” is safer) ◦ be friendly and helpful • Consider adding optional 2FA using an email OTP — it’s simple and adds huge security value. Your UI decisions will directly affect user trust, so keep it clean and intuitive. |
BetaWas this translation helpful?Give feedback.
-
Thanks for posting in the GitHub Community, @Ramesh-kumawat! We're happy you're here. You are more likely to get a useful response if you are posting your question in the applicable category, the Discussions category is solely related to conversations around the GitHub product Discussions. This question should be in the |
BetaWas this translation helpful?Give feedback.
-
Team Menu Makers has implemented a solid authentication foundation using bcrypt, JWT, RBAC, and proper validation. Below are key recommendations for improvement: Security bcrypt is acceptable; design hashing logic to allow future migration to Argon2 if needed. Store hashed refresh tokens in the database and use HttpOnly, Secure cookies. Implement refresh token rotation and revocation. Add rate limiting and temporary lockouts to prevent brute-force attacks. Use generic login error messages and enable audit logging. Architecture Keep authentication within the same backend as a modular component; a separate microservice is not required at this stage. Follow a clean module-based folder structure for maintainability. Manage secrets via environment variables and a secrets manager in production. User Experience Add a password strength meter. Consider optional 2FA as a future enhancement. Keep the login UI minimal, accessible, and non-revealing of account existence. Your current implementation already aligns well with industry practices. With these refinements, it will reach near production-grade standards. |
BetaWas this translation helpful?Give feedback.
-
Hey guys! cool to see students building proper auth systems early on 👏 your setup already looks solid (bcrypt + JWT + RBAC etc), so nice job there. Some quick thoughts from my side: Security bcrypt is fine tbh, but yea Argon2 is kinda more modern and recommended lately (memory hard, better protection against GPU attacks). You can switch if it’s easy right now, otherwise bcrypt still acceptable. Refresh tokens should NOT sit in localstorage. Better in httpOnly cookies, and rotate on every refresh. Keep a DB table to blacklist/track old tokens. Definitely add rate limiting. Account lockout after like 5–7 failed attempts or gradual cool-down helps against brute force. IP throttling + captcha after too many retries could be nice later. Architecture Microservice only if you expect scaling later. For now monolith auth module is fine, simpler to maintain. Separate auth into its own folder with: /auth Keeps things clean. Secrets → .env, but not committed. If production later use Vault/AWS Secrets/Cloud KMS. UX password strength meter? good idea, users get clarity. 2FA maybe later, once you have a stable userbase. Adds friction now but huge trust factor. Keep login form simple as possible, avoid too much data entry. Overall you're going in the right direction. Good work! Keep it up Menu Makers 🚀 |
BetaWas this translation helpful?Give feedback.
-
Great work so far, Team Menu Makers! Your implementation already covers many important security fundamentals. Here's my feedback on each of your questions: Security1. Bcrypt vs Argon2Stick with bcrypt for now. Here's why:
Recommendation: Use bcrypt with a cost factor of 12-14. If you want to impress evaluators, mention you considered Argon2 and explain the tradeoffs. 2. JWT Refresh Token Storage & RotationBest practices: // Store refresh tokens in database with metadata{userId: "123",refreshToken: "hashed_token",expiresAt: Date,deviceInfo: "User-Agent string",createdAt: Date,lastUsed: Date}Rotation strategy:
Storage:
3. Preventing Brute-Force AttacksMulti-layered approach: // Option 1: express-rate-limit (simple)importrateLimitfrom'express-rate-limit';constloginLimiter=rateLimit({windowMs: 15*60*1000,// 15 minutesmax: 5,// 5 attemptsmessage: 'Too many login attempts, please try again later'});app.post('/login',loginLimiter,loginController);// Option 2: Account-level lockout (more sophisticated)// Track failed attempts in database{email: "[email protected]",failedAttempts: 3,lockedUntil: Dateornull}// Lock account after 5 failed attempts for 30 minutes// Reset counter on successful loginBest approach: Combine both!
4. Rate Limiting ImplementationYES, absolutely implement it! Use:
System Architecture1. Should Auth Be a Separate Microservice?For your project: NO. Here's why: Monolith is better when:
Consider microservices when:
For your case: Keep auth as a module within your monolith, but structure it cleanly (see below). 2. Recommended Folder StructureKey principles:
3. Managing SecretsFor development: # .env file (NEVER commit this!)JWT_SECRET=your-super-secret-key-min-32-charsJWT_REFRESH_SECRET=another-secret-keyDATABASE_URL=postgresql://user:pass@localhost:5432/dbFor production:
Best practices: // config/env.tsimportdotenvfrom'dotenv';dotenv.config();exportconstconfig={jwt: {secret: process.env.JWT_SECRET!,expiresIn: '15m',refreshSecret: process.env.JWT_REFRESH_SECRET!,refreshExpiresIn: '7d'},database: {url: process.env.DATABASE_URL!}};// Validate required env vars on startupif(!config.jwt.secret)thrownewError('JWT_SECRET is required');User Experience1. Password Strength MeterYES, implement it! Users create weak passwords otherwise. Easy implementation: // Use zxcvbn libraryimportzxcvbnfrom'zxcvbn';conststrength=zxcvbn(password);// Returns score 0-4 (weak to strong)Frontend feedback:
2. Two-Factor Authentication (2FA)For a student project: OPTIONAL, but impressive if done right. When to implement:
Simple 2FA options:
Implementation tip: // Make it optional, not mandatory// Users can enable it in settings{userId: "123",twoFactorEnabled: false,twoFactorSecret: null// Store TOTP secret if enabled}3. Simple & Intuitive Login TipsUX best practices:
Additional RecommendationsSecurity Checklist
Testing// Write tests for auth flowsdescribe('Authentication',()=>{it('should login with valid credentials',async()=>{// Test implementation});it('should reject invalid credentials',async()=>{// Test implementation});it('should lock account after 5 failed attempts',async()=>{// Test implementation});});DocumentationCreate an
Priority RoadmapMust Have (Do Now):
Should Have (Next Sprint):
Nice to Have (If Time Permits):
ResourcesGreat job so far, Team Menu Makers! Your current implementation is solid. Focus on the "Must Have" items first, then add the "Should Have" features. Don't over-engineer—shipping a working, secure product is better than a perfect one that's never finished. Feel free to ask follow-up questions! Good luck with your project! |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Discussion Type
Product Feedback
Discussion Content
Hi everyone! 👋
We are Team Menu Makers, a student development team working on an app that requires a secure and user-friendly login system. We want to make sure our design follows industry standards, so we are looking for feedback from experienced developers.
✅ What We Have Implemented So Far
Email + password login
Password hashing using bcrypt
Token-based authentication with JWT
Basic role-based access (user/admin)
Input validation on both frontend and backend
Secure user storage (no plain-text passwords)
Error handling for invalid login attempts
❓ Where We Need Help
Should we switch from bcrypt to Argon2 for password hashing?
Best way to securely store and rotate JWT refresh tokens
Recommended strategies to prevent brute-force attacks
Should we implement rate limiting or account lockout?
Should authentication be separated into its own microservice?
Suggestions for a clean folder structure for auth modules
Best practices for managing secrets (environment variables, vaults, etc.)
Should we add password strength meters?
Is two-factor authentication worth implementing at this stage?
Tips for making the login process simple and intuitive
📘 Tech Stack
Node.js / Express
JWT
PostgreSQL
TypeScript + Vite (frontend)
🙏 Why We’re Asking
We (Team Menu Makers) are required to gather feedback from real developers as part of our weekly learning and design improvement task.
Your advice will help us improve security, optimize our architecture, and write better documentation.
BetaWas this translation helpful?Give feedback.
All reactions