"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>

सवाल
  • ABP Framework version: v8.1.2
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no

I have a Blazor control with javascript depencies that is not functioning on live but does on dev, and I'm wondering if it is related to this error which I am seeing on live but not on dev. Other than that I haven't noticed any other issues. Other Javascript seems to be functioning...

Blazor.BasicTheme.Global.BB84A929188038BEBAC9737CB262B16F.js?_v=638518224531532540:31         
GET https://[livesiteurl]/__bundles/themes/silver/theme.js net::ERR_ABORTED 404 (Not Found)

In the logs I also see other /__bundles/ URLs giving 404 errors.

Suggestions?

Thanks,

Jonathan

उत्तर

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.

  • ABP Framework version: v8.1.2
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no

There seems to be an issue with the logic in modules\account\src\Volo.Abp.Account.Web\Pages\Account\Register.cshtml.cs

On line 71 I see IsExternalLoginOnly but there seems to be NO way to get to this! The function CheckSelfRegistrationAsync returns TRUE if ANY external login exists (line 206) which would obviously make it empossible for line 71 to EVER run and thus for OnPostExternalLogin to ever run. Am I missing something? I disabled both Abp.Account.EnableLocalLogin and Abp.Account.IsSelfRegistrationEnabled but then was surprised to still see a registration screen. What am I missing? I see your response to https://support.abp.io/QA/Questions/6843/External-Provider-login-is-able-to-register-a-user-even-if-self-register-setting-is-disabled but I still think there might be a bug here? Shouldn't line 71 be able to run somehow? Shouldn't there just be a standard place to autoregister a user.

This used to be done easily by a function CreateExternalUserAsync(ExternalLoginInfo info) on LoginModel but that seemed to go away. What is the replacement to that function?

Also, previously I had made the decision to use email address for username for all users but I see this is NOT the default approach ABP takes. Is there a "standard" way to change this? Is overriding UserManager.GetUserNameFromEmailAsync() to just return the email address a bad idea?

Thanks,

Jonathan

It looks like there is a bug in "abp new" for 8.1.1 with the basic theme

  • ABP Framework version: v8.1.1
  • UI Type:Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yno
  • Steps to reproduce the issue:

Run the following: abp new TestMe.MainApp -u blazor-server -csf --version 8.1.1 --theme basic -t app-pro

Gives These Errors:

C:\Users\xxxxxx\source\repos_build\TestMe.MainApp\src\TestMe.MainApp.Blazor\Pages_Host.cshtml(4,42): error CS0234: T he type or namespace name 'Basic' does not exist in the namespace 'Volo.Abp.AspNetCore.Components.Web' (are you missing an assembly reference?) [C:\Users\xxxxxx\source\repos_build\TestMe.MainApp\src\TestMe.MainApp.Blazor\TestMe.MainApp. Blazor.csproj] C:\Users\xxxxxx\source\repos_build\TestMe.MainApp\src\TestMe.MainApp.Blazor\MainAppBlazorModule.cs(70,12): error CS02 46: The type or namespace name 'AbpAspNetCoreMvcUiBasicThemeModule' could not be found (are you missing a using directi ve or an assembly reference?) [C:\Users\xxxxxx\source\repos_build\TestMe.MainApp\src\TestMe.MainApp.Blazor\TestMe.Mai nApp.Blazor.csproj] 0 Warning(s) 2 Error(s)

The template also seems to be using <HeadOutlet> when it should be using this in order to support the MVC pages such as the login page, right?

&lt;component type=&quot;typeof(HeadOutlet)&quot; render-mode=&quot;Server&quot; /&gt;
उत्तर

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

उत्तर

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.

16 प्रविष्टियों में 1 से 10 दिखा रहा है
Made with ❤️ on ABP v8.2.0-preview Updated on मार्च 25, 2024, 15:11