Add test
This commit is contained in:
@@ -35,7 +35,7 @@ public class LoginCommandHandler(
|
||||
}
|
||||
|
||||
// 3. Verify password
|
||||
if (user.PasswordHash == null || !passwordHasher.VerifyPassword(request.Password, user.PasswordHash))
|
||||
if (string.IsNullOrEmpty(user.PasswordHash) || !passwordHasher.VerifyPassword(request.Password, user.PasswordHash))
|
||||
{
|
||||
throw new UnauthorizedAccessException("Invalid credentials");
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class LoginCommandHandler(
|
||||
tenant.Id,
|
||||
cancellationToken);
|
||||
|
||||
if (userTenantRole == null)
|
||||
if (userTenantRole is null)
|
||||
{
|
||||
throw new InvalidOperationException($"User {user.Id} has no role assigned for tenant {tenant.Id}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user