Starts in:
1 DAY
23 HRS
58 MIN
34 SEC
Starts in:
1 D
23 H
58 M
34 S
Open Closed

User Name, SurName, and UserName on Tenant creation #3361


User avatar
0
Leonardo.Willrich created
  • ABP Framework version: 5.3.0
  • UI type: Blazor WASM
  • DB provider: EF Core

Hi,

I want to create the tenant in the database and that the user name, surname, and username have a valid name instead of "admin" as it is hardcoded. What is the best way to implement that? I have a "Register" form where I can add the fields, but, also I'll be creating Tenants from the default CRUD.


1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can remove the IdentityDataSeedContributor and add your DataSeedContributor, it no longer create admin user&role when you removed IdentityDataSeedContributor.

        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            context.Services.Configure<AbpDataSeedOptions>(options =>
            {
                options.Contributors.Remove<IdentityDataSeedContributor>();
            });
        }
    

    You can see the data seed system document:

    https://docs.abp.io/en/abp/latest/Data-Seeding

    https://github.com/abpframework/abp/blob/e3e1779de6df5d26f01cdc8e99ac9cbcb3d24d3c/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeedContributor.cs

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06