Open Closed

HOW TO remove Two factor item #1690


User avatar
0
zhangxd1222 created

I want to remove Two facotr item, so what can i do, thanks


2 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Firstly you have to create your profile menu contributor like below:

    public class CustomProfileMenuContributor : IProfileManagementPageContributor
    {
        public Task ConfigureAsync(ProfileManagementPageCreationContext context)
        {
            context.Groups.ForEach(Console.WriteLine);
    
            context.Groups.Remove(context.Groups.First(x => x.Id == "Volo-Abp-Account-TwoFactor"));
    
            return Task.CompletedTask;
        }
    }
    

    Then go to WebModule class and add your contributor via configuring ProfileManagementPageOptions

    Configure<ProfileManagementPageOptions>(p =>
    {
        p.Contributors.Add(new CustomProfileMenuContributor());
    });
    

    You'll see Two Factor is removed:

  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07