using System; namespace Data_Coupler.Services { public interface IAuthenticationService { bool IsAuthenticated { get; } event Action? OnAuthenticationStateChanged; bool Login(string password); void Logout(); } public class AuthenticationService : IAuthenticationService { // Password hardcoded - CAMBIARE IN PRODUZIONE private const string HARDCODED_PASSWORD = "admin123"; private bool _isAuthenticated = false; public bool IsAuthenticated => _isAuthenticated; public event Action? OnAuthenticationStateChanged; public bool Login(string password) { if (password == HARDCODED_PASSWORD) { _isAuthenticated = true; OnAuthenticationStateChanged?.Invoke(); return true; } return false; } public void Logout() { _isAuthenticated = false; OnAuthenticationStateChanged?.Invoke(); } } }