Open Closed

Db Migration error System.ArgumentNullException: 'Value cannot be null. (Parameter 'normalizedName #7066


User avatar
0
surajlokhandemmew created

ABP Framework version: v8.0.0

UI Type: MVC + Flutter

Database System: MongoDB

Tiered (for MVC) or Auth Server Separated (for Angular): no

Below is the entity with recursion

how to add mongodb with hangfire? there is only one example with usesql as db provider.

and in dbmigrator i am getting error System.ArgumentNullException: 'Value cannot be null. (Parameter 'normalizedName')'

at

public override async Task ProceedAsync()
{
	base.ReturnValue = await Proceed(base.Invocation, ProceedInfo).ConfigureAwait(continueOnCapturedContext: false);
}

please help me on this asap


15 Answer(s)
  • User Avatar
    0
    surajlokhandemmew created

    hi initially it was wrong question, please answer what to do with this error?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    How can I reproduce this?

    Can you share the steps?

    Thanks

    https://docs.abp.io/en/commercial/8.1/migration-guides/v8_1#added-normalizedname-property-to-tenant

  • User Avatar
    0
    surajlokhandemmew created

    I had tried to install hangfire then it ddidnt work and since that time i am getting this error after removing hangfire.

  • User Avatar
    0
    surajlokhandemmew created

    hi please can you help there is not known step to reproduce it, I just followed this https://docs.abp.io/en/abp/latest/Background-Jobs-Hangfire after that i was not able to add mongodb as provider so i uninstalled the package and since that i am getting this error while running db migrator

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share a test project via https://wetransfer.com/ ?

    I will download and check it.

    Thanks

    liming.ma@volosoft.com

  • User Avatar
    0
    surajlokhandemmew created

    can't do that right now , will do tomorrow but meanwhile i need one help. i am having flutter app and this mvc as backoffice since permissions are shared app users can log in into backoffice , how can i avoid it?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    can't do that right now , will do tomorrow but meanwhile i need one help.

    No problem.

    i am having flutter app and this mvc as backoffice since permissions are shared app users can log in into backoffice , how can i avoid it?

    Do you mean your app can only log in via Flutter app?

  • User Avatar
    0
    surajlokhandemmew created

    yes i have created different roles, person with app_user role should not be able to login in backoffice only in flutter

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can override the Login page of backoffice

    https://support.abp.io/QA/Questions/160/How-to-customize-an-ABP-project

  • User Avatar
    0
    surajlokhandemmew created

    I tried following ti but getting errors as below

    and how which method should i override to check for the user role and throw exception.?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    using System.Threading.Tasks;
    using Microsoft.AspNetCore.Authentication;
    using Microsoft.AspNetCore.Identity;
    using Microsoft.AspNetCore.Mvc;
    using Microsoft.Extensions.Options;
    using Owl.reCAPTCHA;
    using Volo.Abp.Account.ExternalProviders;
    using Volo.Abp.Account.Public.Web;
    using Volo.Abp.Account.Public.Web.Pages.Account;
    using Volo.Abp.Account.Security.Recaptcha;
    using Volo.Abp.Account.Web.Pages.Account;
    using Volo.Abp.DependencyInjection;
    using Volo.Abp.OpenIddict;
    using Volo.Abp.Security.Claims;
    
    namespace MyCompanyName.MyProjectName.Web.Pages;
    
    
    [ExposeServices(typeof(LoginModel), typeof(OpenIddictSupportedLoginModel))]
    public class MyLogin : OpenIddictSupportedLoginModel
    {
        public MyLogin(
            IAuthenticationSchemeProvider schemeProvider,
            IOptions<AbpAccountOptions> accountOptions,
            IAbpRecaptchaValidatorFactory recaptchaValidatorFactory,
            IAccountExternalProviderAppService accountExternalProviderAppService,
            ICurrentPrincipalAccessor currentPrincipalAccessor,
            IOptions<IdentityOptions> identityOptions,
            IOptionsSnapshot<reCAPTCHAOptions> reCaptchaOptions,
            AbpOpenIddictRequestHelper openIddictRequestHelper)
            : base(
            schemeProvider,
            accountOptions,
            recaptchaValidatorFactory,
            accountExternalProviderAppService,
            currentPrincipalAccessor,
            identityOptions,
            reCaptchaOptions,
            openIddictRequestHelper)
        {
    
        }
    
        public override Task<IActionResult> OnPostAsync(string action)
        {
            // Check the  LoginInput.UserNameOrEmailAddress,
            return base.OnPostAsync(action);
        }
    }
    
    
    
  • User Avatar
    0
    surajlokhandemmew created

    not working , can you please guide me step by step or provide article for the same

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    not working

    Can you share details? What do you mean not working?

    Thanks.

  • User Avatar
    0
    surajlokhandemmew created

    hi

    not working

    Can you share details? What do you mean not working?

    Thanks.

    Hi i mean i can only check username and email , how can i check the role of the user?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can try with the code below.

    [UnitOfWork] 
    public override Task<IActionResult> OnPostAsync(string action)
    {
        await IdentityOptions.SetAsync();
    
        var user = await UserManager.FindByNameAsync(LoginInput.UserNameOrEmailAddress) ??
                   await UserManager.FindByEmailAsync(LoginInput.UserNameOrEmailAddress);
        if (user == null)
        {
            return await base.OnPostAsync(action);
        }
        
        var result = await UserManager.CheckPasswordAsync(user, LoginInput.Password);
        if (!result)
        {
            return await base.OnPostAsync(action);
        }
    
        var userRoles = await UserManager.GetRolesAsync(user);
    
        //Check the user roles
        
    
    
        return await base.OnPostAsync(action);
    }
    
Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38