From a11e1c20a0c378414ef63b7f7d46be0ff7461ce2 Mon Sep 17 00:00:00 2001 From: Mirko Da Corte Date: Wed, 21 Sep 2022 04:15:11 +0200 Subject: [PATCH] fix wrong check --- src/EthernaSSO.Domain/Models/UserBase.cs | 1 - src/EthernaSSO/Configs/Identity/CustomUserValidator.cs | 9 --------- 2 files changed, 10 deletions(-) diff --git a/src/EthernaSSO.Domain/Models/UserBase.cs b/src/EthernaSSO.Domain/Models/UserBase.cs index ad1f1f79..04948e5c 100644 --- a/src/EthernaSSO.Domain/Models/UserBase.cs +++ b/src/EthernaSSO.Domain/Models/UserBase.cs @@ -110,7 +110,6 @@ public virtual IEnumerable EtherPreviousAddresses public virtual UserBase? InvitedBy { get; protected set; } public virtual bool InvitedByAdmin { get; protected set; } - public virtual bool IsInvited => InvitedByAdmin || InvitedBy is not null; [PersonalData] public virtual DateTime LastLoginDateTime { get; protected set; } //public virtual bool LockoutEnabled => SharedInfo.LockoutEnabled; diff --git a/src/EthernaSSO/Configs/Identity/CustomUserValidator.cs b/src/EthernaSSO/Configs/Identity/CustomUserValidator.cs index 9a72c333..99fdb72a 100644 --- a/src/EthernaSSO/Configs/Identity/CustomUserValidator.cs +++ b/src/EthernaSSO/Configs/Identity/CustomUserValidator.cs @@ -74,15 +74,6 @@ public virtual async Task ValidateAsync(UserManager ma if (user is UserWeb2 userWeb2) ValidateWeb2Logins(userWeb2, errors); - // Validate invitation. - if (user.Id is null && //is registering - applicationSettings.RequireInvitation && !user.IsInvited) - errors.Add(new IdentityError - { - Code = "RequiredInvitation", - Description = "An invitation code is required" - }); - return errors.Count > 0 ? IdentityResult.Failed(errors.ToArray()) : IdentityResult.Success; }