Fixes
This commit is contained in:
@@ -5,6 +5,5 @@ namespace AipsCore.Domain.Models.User.External;
|
||||
|
||||
public interface IUserRepository : IAbstractRepository<User, UserId>
|
||||
{
|
||||
Task SignUpWithPasswordAsync(User user, string password, CancellationToken cancellationToken = default);
|
||||
Task<LoginResult> LoginWithEmailAndPasswordAsync(string email, string password, CancellationToken cancellationToken = default);
|
||||
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace AipsCore.Domain.Models.User.External;
|
||||
|
||||
public record LoginResult(User User, IList<string> Roles);
|
||||
@@ -17,10 +17,8 @@ public record UserRole
|
||||
|
||||
public static IEnumerable<UserRole> All() => [User, Admin];
|
||||
|
||||
public static UserRole FromString(string name)
|
||||
public static UserRole? FromString(string name)
|
||||
{
|
||||
var role = All().FirstOrDefault(r => r.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
return role ?? throw new ValidationException(UserErrors.RoleDoesNotExist(name));
|
||||
return All().FirstOrDefault(r => r.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user