Open Closed

Trying to extend the new account registration #650


User avatar
0
Femi.madariola created

When an account is registered, I want the user's first name and last name to be amongst the information that is collected.

When registering a new account, only the email address, username, password and appname are collected. The implication is that new users that register don't have a first name and last name at the point of registration.

Hence, I want to extend the api/account/register to accept a First name and Last name. { "userName": "string", "emailAddress": "user@example.com", "password": "string", "appName": "string", "returnUrl": "string", "returnUrlHash": "string", "captchaResponse": "string" }

How do I go about this and also what is the "appName" property?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

4 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    HI,

    AppName is your front-end type, can be web, ios, angular.... . It can also be any value.

    You can create a new appservices like:

    [Dependency(ReplaceServices = true)]
    [ExposeServices(typeof(IAccountAppService))]
    public class  MyAccountAppService : AccountAppService
    {
    
    
        public MyAccountAppService(IdentityUserManager userManager, IAccountEmailer accountEmailer, IAccountPhoneService phoneService, IIdentityRoleRepository roleRepository, IdentitySecurityLogManager identitySecurityLogManager, IBlobContainer<AccountProfilePictureContainer> accountProfilePictureContainer, ISettingManager settingManager, IOptions<IdentityOptions> identityOptions) : base(userManager, accountEmailer, phoneService, roleRepository, identitySecurityLogManager, accountProfilePictureContainer, settingManager, identityOptions)
        {
        }
    
        public async Task<IdentityUserDto> MyRegisterAsync(MyRegisterDto input)
        {
            var result =await base.RegisterAsync(new RegisterDto() {....});
    
            var user = await UserManager.FindByIdAsync(result.Id.ToString());
    
            user.Surname = input.SurName;
                .....
    
            await UserManager.UpdateAsync(user);
        }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Femi.madariola created

    Thanks for your response.

    For the AppName: When I put in any value (i.e. I used "Mp_App"), I got the error below:

    Volo.Abp.AbpException: Url, named 'Abp.Account.EmailConfirmation', for the application 'MP_App' was not configured. Use AppUrlOptions to configure it! at Volo.Abp.UI.Navigation.Urls.AppUrlProvider.GetConfiguredUrl(String appName, String urlName) at Volo.Abp.UI.Navigation.Urls.AppUrlProvider.GetUrlAsync(String appName, String urlName)

    What do I do?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Try:

    Configure<AppUrlOptions>(options =>
    {
        options.Applications["Mp_App"].RootUrl = your url....;
    });
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    lataing created

    HI,

    AppName is your front-end type, can be web, ios, angular.... . It can also be any value.

    You can create a new appservices like:

    [Dependency(ReplaceServices = true)] 
    [ExposeServices(typeof(IAccountAppService))] 
    public class  MyAccountAppService : AccountAppService 
    { 
     
     
        public MyAccountAppService(IdentityUserManager userManager, IAccountEmailer accountEmailer, IAccountPhoneService phoneService, IIdentityRoleRepository roleRepository, IdentitySecurityLogManager identitySecurityLogManager, IBlobContainer<AccountProfilePictureContainer> accountProfilePictureContainer, ISettingManager settingManager, IOptions<IdentityOptions> identityOptions) : base(userManager, accountEmailer, phoneService, roleRepository, identitySecurityLogManager, accountProfilePictureContainer, settingManager, identityOptions) 
        { 
        } 
     
        public async Task<IdentityUserDto> MyRegisterAsync(MyRegisterDto input) 
        { 
            var result =await base.RegisterAsync(new RegisterDto() {....}); 
     
            var user = await UserManager.FindByIdAsync(result.Id.ToString()); 
     
            user.Surname = input.SurName; 
                ..... 
     
            await UserManager.UpdateAsync(user); 
        } 
    } 
    

    I can't refer to myregisteraasync because the iaccountappservice interface doesn't have it. I can't refer to the myregisteraasync method.

    What should I do?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.