Activities of "brauerj@gc.adventist.org"

It turned out this was because of trying to use script bunding for the TinyMCE .js depencies which doesn't work since it loads lots of other dependencies based on relative URLs.

Instead I created my own LayoutComponent which includes the dependencies.

=====MyCustomLayout.razor===== @inherits LayoutComponentBase @using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic @layout MainLayout

@Body

<HeadContent> <script src="_content/Blazeditor.TinyMCE/tinymce.min.js"></script> <script src="_content/Blazeditor.TinyMCE/blazeditor.js"></script> </HeadContent>

I agree. It seems clear to me that a setting and pattern or two are missing somewhere to make this much cleaner for the various desired outcomes we each are working towards.

<HeadOutlet/> doesn't seem to be recognized in the code I have from the template. Without <component type="typeof(HeadOutlet)" render-mode="Server" /> my styling "outlets" from blazor don't seem to be getting set.

Besides later on in the same _Host.cshtml file. <component type="typeof(App)" render-mode="Server" /> is used instead of <App>

Blazor tags are not supported in .cshtml files.

This would be a GREAT solution but no longer seems to be available.

I do see I can still override OnGetExternalLoginCallbackAsync for LoginModel which is a bit more messy but seems like it should work.

Perhaps a true/false "enable external user auto creation" setting which defaults to running a function which could be overridden would make the most sense to me.

Do you have a sample on how you'd best see that done? The Authentication-Customization sample in abp-samples still seems to override CreateExternalUserAsync.

The page will have a warning message. This is the default behavior.

I believe this is the default behavior when there are no External Providers but if there are one or more external login providers I believe CheckSelfRegistrationAsync will ALWAYS be true because of line 204:

 protected virtual async Task<bool> CheckSelfRegistrationAsync()
    {
        EnableLocalRegister = await SettingProvider.IsTrueAsync(AccountSettingNames.EnableLocalLogin) &&
                              await SettingProvider.IsTrueAsync(AccountSettingNames.IsSelfRegistrationEnabled);

204     if (IsExternalLogin)
        {
            return true;
        }

        if (!EnableLocalRegister)
        {
            return false;
        }

        return true;
    }

Thus it will show the form WITHOUT the SelfRegistrationDisabledMessage warning and never run OnPostExternalLogin. But anyways I'm hoping I don't need to concern myself with this page as I don't really want them to see a "registration" page, but to auto register in the background (like I used to have it).

IsExternalLoginOnly => EnableLocalLogin == false && ExternalProviders?.Count() == 1;

Which equates to true in my case but line 69 never runs from what I can see:

    public virtual async Task<IActionResult> OnGetAsync()
    {
        ExternalProviders = await GetExternalProviders();

        if (!await CheckSelfRegistrationAsync())
        {
70          if (IsExternalLoginOnly)
            {
                return await OnPostExternalLogin(ExternalLoginScheme);
            }

            Alerts.Warning(L["SelfRegistrationDisabledMessage"]);
        }

        await TrySetEmailAsync();

        return Page();
    }

I think the new method is protected virtual async Task<IdentityUser> RegisterExternalUserAsync(ExternalLoginInfo externalLoginInfo, string userName, string emailAddress)

RegisterExternalUserAsync only seems to run when the Register page is filled out and submitted? I want to avoid that and have them registered in the background without the users involvement. Overriding CreateExternalUserAsync(ExternalLoginInfo info) (referenced here) allowed me to do this. It looks like this was available recently?

Main point, how can I register someone automatically based on the claims received from an external provider? Previously I just overrode CreateExternalUserAsync on LoginModel.

Thanks in advance.

Answer

Adding [DependsOn(typeof(CmsKitProPublicWebModule))] to the MainBlazorModule obtained what I was looking for.

Answer

It looks like your assuming we're using the public website. I'll try adding the public modules to the admin site and see if that works.

running abp update this morning gives the following but still doesn't solve the problem:

{ "version": "1.0.0", "name": "my-app", "private": true, "dependencies": { "@volo/abp.aspnetcore.mvc.ui.theme.leptonx": "~2.1.0", "@volo/account": "~7.2.0", "@volo/aspnetcore.components.server.leptonxtheme": "~2.1.0", "@volo/cms-kit-pro.admin": "~7.2.0", "@volo/language-management": "~7.2.0" } }

This is how my package.json looks after running abp update and install-libs still receiving the error (without my fix):

{ "version": "1.0.0", "name": "my-app", "private": true, "dependencies": { "@volo/abp.aspnetcore.mvc.ui.theme.leptonx": "~2.1.0", "@volo/account": "^7.1.1", "@volo/aspnetcore.components.server.leptonxtheme": "~2.1.0", "@volo/cms-kit-pro.admin": "^7.1.1", "@volo/language-management": "^7.1.1", //"flag-icons": "^6.6.6" } }

doing "yarn add flag-icons" and changing abp.resourcemapping.js to the following and running abp install-libs fixes it but why is this needed?

module.exports = { aliases: { "@node_modules": "./node_modules", "@libs": "./wwwroot/libs" }, clean: [ "@libs", "!@libs/**/foo.txt" ], mappings: { "@node_modules/flag-icon-css/css/*.min.css": "@libs/flag-icon-css/css/", } };

Showing 1 to 10 of 10 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11