コード例 #1
0
        public virtual async Task <bool> 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);
        }
コード例 #2
0
        public virtual async Task <bool> 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);
        }