bub fix 🥺

created authorization service interface
This commit is contained in:
Вячеслав 2025-04-18 14:15:52 +05:00
parent 41ff1555f8
commit 7bff14a66e
3 changed files with 11 additions and 2 deletions

View file

@ -37,7 +37,7 @@ public class Program
builder.Services.AddScoped<IPasswordHasher, Sha256PasswordHasher>(); builder.Services.AddScoped<IPasswordHasher, Sha256PasswordHasher>();
builder.Services.AddScoped<AuthorizationService>(); builder.Services.AddScoped<IAuthorizationService, AuthorizationService>();
builder.Services.AddScoped<ISurveyRepository, SurveyRepository>(); builder.Services.AddScoped<ISurveyRepository, SurveyRepository>();
builder.Services.AddScoped<ISurveyService, SurveyService>(); builder.Services.AddScoped<ISurveyService, SurveyService>();

View file

@ -0,0 +1,9 @@
using SurveyBackend.Core.Models;
namespace SurveyBackend.Core.Services;
public interface IAuthorizationService
{
public Task<string?> LogInUser(string email, string password);
public Task RegisterUser(User user);
}

View file

@ -4,7 +4,7 @@ using SurveyBackend.Services.Helpers;
namespace SurveyBackend.Services.Services; namespace SurveyBackend.Services.Services;
public class AuthorizationService public class AuthorizationService : IAuthorizationService
{ {
private readonly IUserService _userService; private readonly IUserService _userService;
private readonly IPasswordHasher _passwordHasher; private readonly IPasswordHasher _passwordHasher;