|
|
|
@ -2,6 +2,7 @@ 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 |
|
|
|
@ -20,10 +21,10 @@ namespace Volo.Abp.Identity |
|
|
|
|
|
|
|
public virtual async Task<bool> IsOptionalAsync() |
|
|
|
{ |
|
|
|
var feature = await FeatureChecker.GetIdentityTwoFactorBehaviour(); |
|
|
|
var feature = await IdentityTwoFactorBehaviourFeatureHelper.Get(FeatureChecker); |
|
|
|
if (feature == IdentityTwoFactorBehaviour.Optional) |
|
|
|
{ |
|
|
|
var setting = await SettingProvider.GetIdentityTwoFactorBehaviour(); |
|
|
|
var setting = await IdentityTwoFactorBehaviourSettingHelper.Get(SettingProvider); |
|
|
|
if (setting == IdentityTwoFactorBehaviour.Optional) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
@ -35,13 +36,13 @@ namespace Volo.Abp.Identity |
|
|
|
|
|
|
|
public virtual async Task<bool> IsForcedEnableAsync() |
|
|
|
{ |
|
|
|
var feature = await FeatureChecker.GetIdentityTwoFactorBehaviour(); |
|
|
|
var feature = await IdentityTwoFactorBehaviourFeatureHelper.Get(FeatureChecker); |
|
|
|
if (feature == IdentityTwoFactorBehaviour.Forced) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
var setting = await SettingProvider.GetIdentityTwoFactorBehaviour(); |
|
|
|
var setting = await IdentityTwoFactorBehaviourSettingHelper.Get(SettingProvider); |
|
|
|
if (setting == IdentityTwoFactorBehaviour.Forced) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
@ -52,13 +53,13 @@ namespace Volo.Abp.Identity |
|
|
|
|
|
|
|
public virtual async Task<bool> IsForcedDisableAsync() |
|
|
|
{ |
|
|
|
var feature = await FeatureChecker.GetIdentityTwoFactorBehaviour(); |
|
|
|
var feature = await IdentityTwoFactorBehaviourFeatureHelper.Get(FeatureChecker); |
|
|
|
if (feature == IdentityTwoFactorBehaviour.Disabled) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
var setting = await SettingProvider.GetIdentityTwoFactorBehaviour(); |
|
|
|
var setting = await IdentityTwoFactorBehaviourSettingHelper.Get(SettingProvider); |
|
|
|
if (setting == IdentityTwoFactorBehaviour.Disabled) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
|