[CHANGE] Implementing managers. repositories

This commit is contained in:
max
2025-01-03 00:14:12 +01:00
parent 2d96a25906
commit efc8259930
17 changed files with 252 additions and 92 deletions

View File

@@ -1,6 +1,6 @@
using DotBased.AspNet.Authority.Managers;
using DotBased.AspNet.Authority.Models.Authority;
using DotBased.AspNet.Authority.Models.Validation;
using DotBased.AspNet.Authority.Services;
namespace DotBased.AspNet.Authority.Validators;
@@ -10,9 +10,9 @@ public class PasswordEqualsValidator<TUser> : IPasswordValidator<TUser> where TU
private const string ValidationBase = "Authority.Validation.Password";
public async Task<ValidationResult> ValidatePasswordAsync(AuthorityUserManager<TUser> userManager, TUser user, string password)
{
if (user == null || user is not AuthorityUserBase authorityUser)
if (user is not AuthorityUserBase authorityUser)
{
throw new ArgumentException("Invalid user given!", nameof(user));
throw new ArgumentException($"User is not type of {nameof(AuthorityUserBase)}!", nameof(user));
}
List<ValidationError> errors = [];