if (confirmPw.value) validateMatch(); );
mongoose.connect(process.env.MONGO_URI, useNewUrlParser: true, useUnifiedTopology: true ).then(() => console.log('MongoDB connected'));
.logo width: 60px; height: 60px; border-radius: 30px; background: #667eea; margin-bottom: 10px; Mobcash Password Change
// If no token, redirect (optional) window.addEventListener('load', () => const token = localStorage.getItem('mobcash_token'); if (!token) // For demo, just show message; in real app redirect to login console.warn('No auth token found');
// Real-time match check function validateMatch() if (confirmPw.value !== newPw.value) matchError.textContent = '✗ Passwords do not match'; return false; else matchError.textContent = '✓ Passwords match'; matchError.style.color = '#2ecc71'; return true; if (confirmPw
.message-box margin-top: 20px; padding: 12px; border-radius: 10px; text-align: center; font-size: 0.9rem; display: none;
// Form submission form.addEventListener('submit', async (e) => !newPw.value ); if (confirmPw.value) validateMatch()
// Show message helper function showMessage(msg, type) messageBox.textContent = msg; messageBox.className = message-box $type ; setTimeout(() => messageBox.style.display = 'none'; , 5000);
// Compare password method userSchema.methods.comparePassword = async function(candidatePassword) return await bcrypt.compare(candidatePassword, this.password); ;
.error-msg color: #e74c3c; font-size: 0.7rem; display: block; margin-top: 4px;
.footer text-align: center; margin-top: 20px;