hi
now the user has to have email verified by default, but if the user has not enabled TOTP, it still shows Two Factor Authentication page (which comes after login) with an empty list of providers, how do I solve this, maybe I need to override Two Factor Authentication page?
Why did this user enable two-factor authentication?
You can try to override the GetValidTwoFactorProvidersAsync
method of IdentityUserManager
Remove email and phone from TwoFactorProviders
, after that, you don't need to override the page.
Thanks.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Security.Claims;
using Volo.Abp.Settings;
using Volo.Abp.Threading;
namespace Volo.Abp.Identity;
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IdentityUserManager))]
public class MyIdentityUserManager : IdentityUserManager
{
public MyIdentityUserManager(IdentityUserStore store,
IIdentityRoleRepository roleRepository,
IIdentityUserRepository userRepository,
IOptions<IdentityOptions> optionsAccessor,
IPasswordHasher<IdentityUser> passwordHasher,
IEnumerable<IUserValidator<IdentityUser>> userValidators,
IEnumerable<IPasswordValidator<IdentityUser>> passwordValidators,
ILookupNormalizer keyNormalizer,
IdentityErrorDescriber errors,
IServiceProvider services,
ILogger<IdentityUserManager> logger,
ICancellationTokenProvider cancellationTokenProvider,
IOrganizationUnitRepository organizationUnitRepository,
ISettingProvider settingProvider,
IDistributedEventBus distributedEventBus,
IIdentityLinkUserRepository identityLinkUserRepository,
IDistributedCache<AbpDynamicClaimCacheItem> dynamicClaimCache)
: base(store, roleRepository, userRepository, optionsAccessor, passwordHasher, userValidators,
passwordValidators, keyNormalizer, errors, services, logger, cancellationTokenProvider,
organizationUnitRepository, settingProvider, distributedEventBus, identityLinkUserRepository,
dynamicClaimCache)
{
}
public override async Task<IList<string>> GetValidTwoFactorProvidersAsync(IdentityUser user)
{
var providers = await base.GetValidTwoFactorProvidersAsync(user);
providers.RemoveAll(x => x == TokenOptions.DefaultEmailProvider || x == TokenOptions.DefaultPhoneProvider);
return providers;
}
}
ok, please share the new Debug logs.
Thanks.
hi
You can consider copying the code from https://github.com/abpframework/abp/pull/22628/files and overriding the feature management module in your project.
The order of getting features is:
If the tenant has not assigned an edition and feature settings have been made on the tenant, these will persist when an edition is assigned (but the tenant will not receive the feature settings of the edition).
If a feature value exists at the tenant level(provide name T), it will not get a value from the edition.
Tenant's priority is more than Edition(provide name E).
When changing an edition on the tenant, all feature settings previously made on the tenant will be deleted.
No. It will not delete the tenant feature.
Thanks.
hi
I have sent the source code.
Thanks.
hi
CorsOrigins
section of appsettings.json
CORS policy execution failed.
Request origin https://sitehostweb.azurewebsites.net does not have permission to access the resource.
hi
Please send an email to liming.ma@volosoft.com
I will share the LeptonX account layout(4.2.1) with you.
Thanks
You don't need to override the cshtml page. Just need the SendSecurityCodeModel
Thanks.
hi
What is the error?
Can you share debug logs?
liming.ma@volosoft.com
https://abp.io/support/questions/8622/How-to-enable-Debug-logs-for-troubleshoot-problems
Thanks
hi
ok, can you test your case in a new, same version template project?
If you can reproduce it in a new project, that would be helpful.
Thanks.