diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityFeature.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityFeature.cs deleted file mode 100644 index a51a3c11f7..0000000000 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityFeature.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.Identity.Features -{ - public class IdentityFeature - { - public const string GroupName = "Identity"; - - public const string TwoFactor = GroupName + ".TwoFactor"; - } -} diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityFeatureDefinitionProvider.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityFeatureDefinitionProvider.cs deleted file mode 100644 index d26cc17b92..0000000000 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityFeatureDefinitionProvider.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using Volo.Abp.Features; -using Volo.Abp.Identity.Localization; -using Volo.Abp.Localization; -using Volo.Abp.Validation.StringValues; - -namespace Volo.Abp.Identity.Features -{ - public class IdentityFeatureDefinitionProvider : FeatureDefinitionProvider - { - public override void Define(IFeatureDefinitionContext context) - { - var group = context.AddGroup(IdentityFeature.GroupName, L("Feature:IdentityGroup")); - - group.AddFeature(IdentityFeature.TwoFactor, - IdentityTwoFactorBehaviour.Optional.ToString(), - L("Feature:TwoFactor"), - L("Feature:TwoFactorDescription"), - new SelectionStringValueType - { - ItemSource = new StaticSelectionStringValueItemSource( - new LocalizableSelectionStringValueItem - { - Value = IdentityTwoFactorBehaviour.Optional.ToString(), - DisplayText = GetTwoFactorBehaviourLocalizableStringInfo("Feature:TwoFactor.Optional") - }, - new LocalizableSelectionStringValueItem - { - Value = IdentityTwoFactorBehaviour.Disabled.ToString(), - DisplayText = GetTwoFactorBehaviourLocalizableStringInfo("Feature:TwoFactor.Disabled") - }, - new LocalizableSelectionStringValueItem - { - Value = IdentityTwoFactorBehaviour.Forced.ToString(), - DisplayText = GetTwoFactorBehaviourLocalizableStringInfo("Feature:TwoFactor.Forced") - } - ) - }); - } - - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } - - private static LocalizableStringInfo GetTwoFactorBehaviourLocalizableStringInfo(string key) - { - return new LocalizableStringInfo(LocalizationResourceNameAttribute.GetName(typeof(IdentityResource)), key); - } - } -} diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityTwoFactorBehaviour.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityTwoFactorBehaviour.cs deleted file mode 100644 index 4e415a7cfb..0000000000 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityTwoFactorBehaviour.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Volo.Abp.Identity.Features -{ - public enum IdentityTwoFactorBehaviour - { - Optional, - - Disabled, - - Forced - } -} diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityTwoFactorBehaviourFeatureHelper.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityTwoFactorBehaviourFeatureHelper.cs deleted file mode 100644 index 6d8d9f33a7..0000000000 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityTwoFactorBehaviourFeatureHelper.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Threading.Tasks; -using JetBrains.Annotations; -using Volo.Abp.Features; - -namespace Volo.Abp.Identity.Features -{ - public static class IdentityTwoFactorBehaviourFeatureHelper - { - public static async Task Get([NotNull] IFeatureChecker featureChecker) - { - Check.NotNull(featureChecker, nameof(featureChecker)); - - var value = await featureChecker.GetOrNullAsync(IdentityFeature.TwoFactor); - if (value.IsNullOrWhiteSpace() || !Enum.TryParse(value, out var behaviour)) - { - throw new AbpException($"{IdentityFeature.TwoFactor} feature value is invalid"); - } - - return behaviour; - } - } -} diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json index fc39751980..68f4318991 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json @@ -78,12 +78,6 @@ "Permission:ChangePermissions": "Change permissions", "Permission:UserManagement": "User management", "Permission:UserLookup": "User lookup", - "Feature:IdentityGroup": "Identity", - "Feature:TwoFactor": "Two factor behaviour", - "Feature:TwoFactorDescription": "Set two factor behaviour. Optional values: Optional,Disabled,Forced", - "Feature:TwoFactor.Optional": "Optional", - "Feature:TwoFactor.Disabled": "Disabled", - "Feature:TwoFactor.Forced": "Forced", "DisplayName:Abp.Identity.Password.RequiredLength": "Required length", "DisplayName:Abp.Identity.Password.RequiredUniqueChars": "Required unique characters number", "DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "Required non-alphanumeric character", @@ -111,10 +105,6 @@ "Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "Whether the phoneNumber can be confirmed by the user.", "Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "Whether a confirmed telephone number is required to sign in.", "Description:Abp.Identity.User.IsUserNameUpdateEnabled": "Whether the username can be updated by the user.", - "Description:Abp.Identity.User.IsEmailUpdateEnabled": "Whether the email can be updated by the user.", - "DisplayName:Abp.Identity.TwoFactorBehaviour": "Two Factor behaviour", - "Description:Abp.Identity.TwoFactorBehaviour": "Two Factor behaviour", - "DisplayName:Abp.Identity.UsersCanChange": "Allow users to change their Two Factor.", - "Description:Abp.Identity.UsersCanChange": "Allow users to change their Two Factor." + "Description:Abp.Identity.User.IsEmailUpdateEnabled": "Whether the email can be updated by the user." } } diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json index 09707f73c2..2ad19c80f4 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json @@ -76,12 +76,6 @@ "Permission:ChangePermissions": "İzinleri değiştirme", "Permission:UserManagement": "Kullanıcı yönetimi", "Permission:UserLookup": "Kullanıcı sorgulama", - "Feature:IdentityGroup": "Kimlik", - "Feature:TwoFactor": "İki faktörlü kimlik doğrulama", - "Feature:TwoFactorDescription": "İki faktörlü kimlik doğrulamanın talep edileceği durumu seçin", - "Feature:TwoFactor.Optional": "İsteğe bağlı", - "Feature:TwoFactor.Disabled": "Asla", - "Feature:TwoFactor.Forced": "Her zaman", "DisplayName:Abp.Identity.Password.RequiredLength": "Uzunluk gerekli", "DisplayName:Abp.Identity.Password.RequiredUniqueChars": "Tekil karakter gerekli", "DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "Alfasayısal olmayan karakter gerekli", @@ -109,10 +103,6 @@ "Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "Oturum açmak için telefon numarası gerekli", "Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "Oturum açmak için onaylanmış bir telefon numarasının gerekli olup olmadığı.", "Description:Abp.Identity.User.IsUserNameUpdateEnabled": "Kullanıcı adının, kullanıcının kendisi tarafından güncellenebilirliği.", - "Description:Abp.Identity.User.IsEmailUpdateEnabled": "E-posta alanının, kullanıcının kendisi tarafından güncellenebilirliği", - "DisplayName:Abp.Identity.TwoFactorBehaviour": "İki faktörlü kimlik doğrulama davranışı", - "Description:Abp.Identity.TwoFactorBehaviour": "İki faktörlü kimlik doğrulama davranışı", - "DisplayName:Abp.Identity.UsersCanChange": "Kullanıcıların iki faktörlü kimlik doğrulama davranışını değiştirmelerine izin verin.", - "Description:Abp.Identity.UsersCanChange": "Kullanıcıların iki faktörlü kimlik doğrulama davranışını değiştirmelerine izin verin" + "Description:Abp.Identity.User.IsEmailUpdateEnabled": "E-posta alanının, kullanıcının kendisi tarafından güncellenebilirliği" } } diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json index 7b084c473e..ec3c4dbbb8 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json @@ -78,12 +78,6 @@ "Permission:ChangePermissions": "更改权限", "Permission:UserManagement": "用户管理", "Permission:UserLookup": "用户查询", - "Feature:IdentityGroup": "身份标识", - "Feature:TwoFactor": "双因素身份验证行为", - "Feature:TwoFactorDescription": "设置双因素身份验证行为. 可选值:可选,禁用,强制启用", - "Feature:TwoFactor.Optional": "可选", - "Feature:TwoFactor.Disabled": "禁用", - "Feature:TwoFactor.Forced": "强制启用", "DisplayName:Abp.Identity.Password.RequiredLength": "要求长度", "DisplayName:Abp.Identity.Password.RequiredUniqueChars": "要求唯一字符数量", "DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "要求非字母数字", @@ -111,10 +105,6 @@ "Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "用户是否可以确认电话号码", "Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "登录时是否需要验证的手机号码.", "Description:Abp.Identity.User.IsUserNameUpdateEnabled": "是否允许用户更新用户名.", - "Description:Abp.Identity.User.IsEmailUpdateEnabled": "是否允许用户更新电子邮箱.", - "DisplayName:Abp.Identity.TwoFactorBehaviour": "双因素身份验证行为", - "Description:Abp.Identity.TwoFactorBehaviour": "双因素身份验证行为", - "DisplayName:Abp.Identity.UsersCanChange": "允许用户更改其因素身份验证.", - "Description:Abp.Identity.UsersCanChange": "允许用户更改其因素身份验证." + "Description:Abp.Identity.User.IsEmailUpdateEnabled": "是否允许用户更新电子邮箱." } -} \ No newline at end of file +} diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json index 5a4c96d111..54298f530d 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json @@ -78,12 +78,6 @@ "Permission:ChangePermissions": "更改權限", "Permission:UserManagement": "使用者管理", "Permission:UserLookup": "使用者查詢", - "Feature:IdentityGroup": "身份識別", - "Feature:TwoFactor": "雙因素身份驗證行為", - "Feature:TwoFactorDescription": "設置雙因素身份驗證行為. 可選值:可選,禁用,強制啟用", - "Feature:TwoFactor.Optional": "選用", - "Feature:TwoFactor.Disabled": "關閉", - "Feature:TwoFactor.Forced": "強制啟用", "DisplayName:Abp.Identity.Password.RequiredLength": "長度需符合", "DisplayName:Abp.Identity.Password.RequiredUniqueChars": "需最小特殊字元數", "DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "需包含非數字字母", @@ -111,10 +105,6 @@ "Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "是否啟用電話認證.", "Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "決定使用者是否需電話認證後才能登入.", "Description:Abp.Identity.User.IsUserNameUpdateEnabled": "決定使用者是否能更新帳號.", - "Description:Abp.Identity.User.IsEmailUpdateEnabled": "決定使用者是否能更新信箱.", - "DisplayName:Abp.Identity.TwoFactorBehaviour": "雙因素認證行為", - "Description:Abp.Identity.TwoFactorBehaviour": "雙因素認證行為", - "DisplayName:Abp.Identity.UsersCanChange": "允許使用者變更雙因素認證.", - "Description:Abp.Identity.UsersCanChange": "允許使用者變更雙因素認證." + "Description:Abp.Identity.User.IsEmailUpdateEnabled": "決定使用者是否能更新信箱." } } diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Settings/IdentitySettingNames.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Settings/IdentitySettingNames.cs index 879c3ffd4c..968b732092 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Settings/IdentitySettingNames.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Settings/IdentitySettingNames.cs @@ -48,14 +48,5 @@ public const string MaxUserMembershipCount = OrganizationUnitPrefix + ".MaxUserMembershipCount"; } - - public static class TwoFactor - { - private const string TwoFactorPrefix = Prefix + ".TwoFactor"; - - public const string Behaviour = TwoFactorPrefix + ".Behaviour"; - - public const string UsersCanChange = TwoFactorPrefix + ".UsersCanChange"; - } } } diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Settings/IdentityTwoFactorBehaviourSettingHelper.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Settings/IdentityTwoFactorBehaviourSettingHelper.cs deleted file mode 100644 index 46d7d414a6..0000000000 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Settings/IdentityTwoFactorBehaviourSettingHelper.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Threading.Tasks; -using JetBrains.Annotations; -using Volo.Abp.Identity.Features; -using Volo.Abp.Settings; - -namespace Volo.Abp.Identity.Settings -{ - public static class IdentityTwoFactorBehaviourSettingHelper - { - public static async Task Get([NotNull] ISettingProvider settingProvider) - { - Check.NotNull(settingProvider, nameof(settingProvider)); - - var value = await settingProvider.GetOrNullAsync(IdentitySettingNames.TwoFactor.Behaviour); - if (value.IsNullOrWhiteSpace() || !Enum.TryParse(value, out var behaviour)) - { - throw new AbpException($"{IdentitySettingNames.TwoFactor.Behaviour} setting value is invalid"); - } - - return behaviour; - } - } -} diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj b/modules/identity/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj index 1cc6517664..e951457688 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj @@ -22,9 +22,7 @@ - - diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs index cff38810c9..bc1ca00b25 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs @@ -1,5 +1,4 @@ -using Volo.Abp.Identity.Features; -using Volo.Abp.Identity.Localization; +using Volo.Abp.Identity.Localization; using Volo.Abp.Identity.Settings; using Volo.Abp.Localization; using Volo.Abp.Settings; @@ -112,19 +111,7 @@ namespace Volo.Abp.Identity int.MaxValue.ToString(), L("Identity.OrganizationUnit.MaxUserMembershipCount"), L("Identity.OrganizationUnit.MaxUserMembershipCount"), - true), - - new SettingDefinition(IdentitySettingNames.TwoFactor.Behaviour, - IdentityTwoFactorBehaviour.Optional.ToString(), - L("DisplayName:Abp.Identity.TwoFactorBehaviour"), - L("Description:Abp.Identity.TwoFactorBehaviour"), - isVisibleToClients: true), - - new SettingDefinition(IdentitySettingNames.TwoFactor.UsersCanChange, - true.ToString(), - L("DisplayName:Abp.Identity.UsersCanChange"), - L("Description:Abp.Identity.UsersCanChange"), - isVisibleToClients: true) + true) ); } diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityTwoFactorManager.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityTwoFactorManager.cs deleted file mode 100644 index 75e74afa3c..0000000000 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityTwoFactorManager.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Domain.Services; -using Volo.Abp.Features; -using Volo.Abp.Identity.Features; -using Volo.Abp.Identity.Settings; -using Volo.Abp.Settings; - -namespace Volo.Abp.Identity -{ - public class IdentityTwoFactorManager : IDomainService - { - protected IFeatureChecker FeatureChecker { get; } - - protected ISettingProvider SettingProvider { get; } - - public IdentityTwoFactorManager(IFeatureChecker featureChecker, ISettingProvider settingProvider) - { - FeatureChecker = featureChecker; - SettingProvider = settingProvider; - } - - public virtual async Task IsOptionalAsync() - { - var feature = await IdentityTwoFactorBehaviourFeatureHelper.Get(FeatureChecker); - if (feature == IdentityTwoFactorBehaviour.Optional) - { - var setting = await IdentityTwoFactorBehaviourSettingHelper.Get(SettingProvider); - if (setting == IdentityTwoFactorBehaviour.Optional) - { - return true; - } - } - - return false; - } - - public virtual async Task IsForcedEnableAsync() - { - var feature = await IdentityTwoFactorBehaviourFeatureHelper.Get(FeatureChecker); - if (feature == IdentityTwoFactorBehaviour.Forced) - { - return true; - } - - var setting = await IdentityTwoFactorBehaviourSettingHelper.Get(SettingProvider); - if (setting == IdentityTwoFactorBehaviour.Forced) - { - return true; - } - - return false; - } - - public virtual async Task IsForcedDisableAsync() - { - var feature = await IdentityTwoFactorBehaviourFeatureHelper.Get(FeatureChecker); - if (feature == IdentityTwoFactorBehaviour.Disabled) - { - return true; - } - - var setting = await IdentityTwoFactorBehaviourSettingHelper.Get(SettingProvider); - if (setting == IdentityTwoFactorBehaviour.Disabled) - { - return true; - } - return false; - } - } -} diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserStore.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserStore.cs index ccc3e055f5..17a0fbd39d 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserStore.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserStore.cs @@ -11,11 +11,7 @@ using Microsoft.Extensions.Logging; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories; -using Volo.Abp.Features; using Volo.Abp.Guids; -using Volo.Abp.Identity.Features; -using Volo.Abp.Identity.Settings; -using Volo.Abp.Settings; namespace Volo.Abp.Identity { @@ -60,17 +56,12 @@ namespace Volo.Abp.Identity protected ILookupNormalizer LookupNormalizer { get; } protected IIdentityUserRepository UserRepository { get; } - protected IFeatureChecker FeatureChecker { get; } - protected ISettingProvider SettingProvider { get; } - public IdentityUserStore( IIdentityUserRepository userRepository, IIdentityRoleRepository roleRepository, IGuidGenerator guidGenerator, ILogger logger, ILookupNormalizer lookupNormalizer, - IFeatureChecker featureChecker, - ISettingProvider settingProvider, IdentityErrorDescriber describer = null) { UserRepository = userRepository; @@ -78,8 +69,6 @@ namespace Volo.Abp.Identity GuidGenerator = guidGenerator; Logger = logger; LookupNormalizer = lookupNormalizer; - FeatureChecker = featureChecker; - SettingProvider = settingProvider; ErrorDescriber = describer ?? new IdentityErrorDescriber(); } @@ -942,33 +931,13 @@ namespace Volo.Abp.Identity /// The that represents the asynchronous operation, containing a flag indicating whether the specified /// has two factor authentication enabled or not. /// - public virtual async Task GetTwoFactorEnabledAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) + public virtual Task GetTwoFactorEnabledAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); Check.NotNull(user, nameof(user)); - var feature = await IdentityTwoFactorBehaviourFeatureHelper.Get(FeatureChecker); - if (feature == IdentityTwoFactorBehaviour.Disabled) - { - return false; - } - if (feature == IdentityTwoFactorBehaviour.Forced) - { - return true; - } - - var setting = await IdentityTwoFactorBehaviourSettingHelper.Get(SettingProvider); - if (setting == IdentityTwoFactorBehaviour.Disabled) - { - return false; - } - if (setting == IdentityTwoFactorBehaviour.Forced) - { - return true; - } - - return user.TwoFactorEnabled; + return Task.FromResult(user.TwoFactorEnabled); } ///