using AuthApp.Data; using AuthApp.Utils; /// /// Сервис аутентификации /// namespace AuthApp.Services { public class AuthService { private readonly UserRepository _repository = new(); /// /// Проверка логина и пароля /// public bool Authenticate(string login, string password) { var user = _repository.GetUser(login); if (user == null) return false; string hash = PasswordHasher.Hash(password); return (user.PasswordHash == hash); } } }