Adding role creation during startup + minor fixes in tests

This commit is contained in:
2025-03-16 22:41:44 +01:00
parent 7f5178883d
commit 18e713153b
48 changed files with 1449 additions and 340 deletions

View File

@@ -17,10 +17,11 @@ public class AuthService : BaseService, IAuthService
protected readonly IUserService _userService;
public AuthService(
IHttpContextAccessor httpContextAccessor,
IConfiguration configuration,
SqlServerContext sqlServerContext,
IUserService userService
) : base(configuration, sqlServerContext)
) : base(httpContextAccessor, configuration, sqlServerContext)
{
_cryptUtils = new CryptUtils(_appSettings);
_userService = userService;
@@ -29,7 +30,8 @@ public class AuthService : BaseService, IAuthService
public async Task<AuthenticatedUser?> AuthenticateAsync(AuthenticateRequestData data)
{
AuthenticatedUser? authenticatedUser = null;
var decryptedUsername = _cryptUtils.Decrypt(data.Username ?? String.Empty);
var decryptedUsername = _cryptUtils.Decrypt(data.Email ?? String.Empty);
var decryptedPassword = _cryptUtils.Decrypt(data.Password ?? String.Empty);
if (!String.IsNullOrEmpty(decryptedUsername) && !String.IsNullOrEmpty(decryptedPassword))