loreal-sla-calculator/server/utils/validators.js
Vadym Samoilenko d1af08786c Add Node.js/Express backend, PostgreSQL, email/password auth, and Docker deployment
- Add Express server (server/) with JWT auth, rate limiting, and all /api/auth/* routes
- Add PostgreSQL schema and migration runner (3 migrations)
- Add email/password login, registration, password reset via Mailgun
- Validate MSAL SSO ID token server-side, upsert user into DB
- Rewrite auth.js: 8-panel auth UI (SSO, login, register, forgot, reset, verify)
- Expand index.html auth overlay with full multi-view auth UI
- Add apiFetch() helper in script.js with auto token refresh
- Add Dockerfile, docker-compose.yml, .dockerignore for containerised deployment
- Add idempotent deploy.sh: git pull, docker build, migrate, copy static to /var/www
- Add .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 19:27:44 +00:00

17 lines
538 B
JavaScript

'use strict';
function isLorealEmail(email) {
if (typeof email !== 'string') return false;
return /^[^\s@]+@loreal\.com$/i.test(email.trim());
}
// Minimum 8 chars, at least one uppercase, one lowercase, one digit
function isStrongPassword(password) {
if (typeof password !== 'string' || password.length < 8) return false;
if (!/[A-Z]/.test(password)) return false;
if (!/[a-z]/.test(password)) return false;
if (!/[0-9]/.test(password)) return false;
return true;
}
module.exports = { isLorealEmail, isStrongPassword };