SOLID Principles in JavaScript
Which SOLID principle is violated when a class handles both user authentication and logging operations?
class UserAuth {
constructor() {
this.logger = new Logger();
}
login(username, password) {
// Authentication logic
this.logger.log('User login attempt');
}
logout() {
// Logout logic
this.logger.log('User logged out');
}
generateLoginReport() {
// Generate login statistics
}
}