Open Closed

Auth-server problems when it is requested from electron #6265


User avatar
0
mmaldonado@emscltd.com created
  • ABP Framework version: 6.0.3
  • UI Type: Angular
  • Database System: EF Core - SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

I have my client based on angular, as usual, I decide to create a desktop version of it using electron, it is working. The only problem that I am facing, is on auth-server, when loading https://localhost:44322/Account/Login jquery is not loagin properly, when i load from electron app, Network

I am assuming it is because jquery is loaded after LeptonX.global js is loaded

so, my question is,

is it possible to override a bundles, global bundles to make jquery be present first. is it possible to override the main layout.cshtml like vies/pages/_Layout.cshtml to load jquery manually here

any idea is welcome


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

    is it possible to override a bundles, global bundles to make jquery be present first. is it possible to override the main layout.cshtml like vies/pages/_Layout.cshtml to load jquery manually here

    Hi,

    You can try:

    public class MyBundleContributor : BundleContributor
    {
        public override void ConfigureBundle(BundleConfigurationContext context)
        {
            context.Files.Insert(0, "/lib/jquery/jquery.js");
        }
    }
    
    Configure<AbpBundlingOptions>(options =>
    {
        options.ScriptBundles.Configure(
            LeptonXThemeBundles.Scripts.Global,
            bundle =>
            {
                bundle.AddContributors(new MyBundleContributor());
            }
        );
    });
    
  • User Avatar
    0
    mmaldonado@emscltd.com created

    is it a way to refresh redis? I tested on my localhost and it works. Also something interesting is,

    development

    production

    any idea why jquery is not on production ?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    is it a way to refresh redis?

    I didn't get it.

    I tested on my localhost and it works. Also something interesting is, any idea why jquery is not on production ?

    The bundle system will bundles & minifies for the production environment: https://docs.abp.io/en/abp/latest/UI/AspNetCore/Bundling-Minification#bundling-mode

    You can try configuring the AbpBundlingOptions or ignore Jquery file.

    Configure<AbpBundlingOptions>(options =>
    {
        options.Mode = BundlingMode.None;
    });
    
    Or..
    
    Configure<AbpBundlingOptions>(options =>
    {
        options.MinificationIgnoredFiles.Add("/lib/jquery/jquery.js");
    });
    
  • User Avatar
    0
    mmaldonado@emscltd.com created

    the order of scripts is better now, but it still not work.

    is it possible to import jquery from header section?

  • User Avatar
    1
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Seems the problem is not related to ABP but Electron.

    See: https://github.com/electron/electron/issues/345 https://github.com/electron/electron/issues/15404#issuecomment-433546435

    You may need to disable the nodeIntegration

  • User Avatar
    0
    mmaldonado@emscltd.com created

    Thank you very much

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11