first commit

This commit is contained in:
Your Name 2026-01-21 00:23:28 +03:00
commit 1530450313
165 changed files with 8443 additions and 0 deletions

View file

@ -0,0 +1,25 @@
using AuthApp.Data;
using AuthApp.Utils;
/// <summary>
/// Сервис аутентификации
/// </summary>
namespace AuthApp.Services
{
public class AuthService
{
private readonly UserRepository _repository = new();
/// <summary>
/// Проверка логина и пароля
/// </summary>
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);
}
}
}