ABP Commercial 9.1.0 / Blazor Server / EF / Non tiered / Separate Host and Tenant DBs / Lepton Theme
Hi, after upgrading from ABP 7.4.2 to 9.1.0 we are experiencing the issue described in the following link: https://github.com/abpframework/abp/issues/20619
Any recommendations?
We were using -t app
instead of -t app-pro
. Only -t app-pro
allows for the Lepton theme to be specified.
ABP Commercial 9.1.0 / Blazor Server / EF / Non tiered / Separate Host and Tenant DBs / Lepton Theme
In version 7.4.2, we relied on an override to AppUrlProvider
to support subdomain base multi-tenancy. Our override was on the ReplacePlaceHoldersAsync
method which appears to no longer be available in abp 9.1.0. Please see our override in ABP 7.4.2 and advise on how to accomplish this in ABP 9.1.0.
using JetBrains.Annotations;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
using Volo.Abp.UI.Navigation.Urls;
using Microsoft.Extensions.Localization;
using Volo.Abp.Sms;
using Microsoft.Extensions.Options;
using FM.nVision.Saas;
using Volo.Abp.Features;
namespace FM.nVision.Account
{
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IAppUrlProvider), typeof(AppUrlProvider), typeof(ITransientDependency))]
[RequiresFeature(SaasConsts.nVisionFeature, SaasConsts.TimepieceFeature)]
[RemoteService(IsEnabled = false)]
public class nVisionAppUrlProvider : AppUrlProvider
{
public const string TenantSubdomainPlaceHolder = "{{subdomain}}";
IFMTenantRepository _fmTenantRepository { get; set; }
public nVisionAppUrlProvider(
IOptions<AppUrlOptions> options,
ICurrentTenant currentTenant,
ITenantStore tenantStore,
IFMTenantRepository fmTenantRepository) : base(options, currentTenant, tenantStore)
{
_fmTenantRepository = fmTenantRepository;
}
protected override async Task<string> ReplacePlaceHoldersAsync(string url)
{
url = await base.ReplacePlaceHoldersAsync(url);
var tenantSubdomainPlaceHolder = TenantSubdomainPlaceHolder;
if (url.Contains(TenantSubdomainPlaceHolder + '.'))
{
tenantSubdomainPlaceHolder = TenantSubdomainPlaceHolder + '.';
}
if (url.Contains(tenantSubdomainPlaceHolder))
{
if (CurrentTenant.Id.HasValue)
{
var subdomain = await GetCurrentTenantSubdomainAsync();
if (!subdomain.IsNullOrWhiteSpace())
{
url = url.Replace(tenantSubdomainPlaceHolder, subdomain + ".");
}
else
{
url = url.Replace(tenantSubdomainPlaceHolder, "");
}
}
else
{
url = url.Replace(tenantSubdomainPlaceHolder, "");
}
}
return url;
}
private async Task<string> GetCurrentTenantSubdomainAsync()
{
if (CurrentTenant.Id.HasValue)
{
return await _fmTenantRepository.GetSubdomainByTenantIdAsync(CurrentTenant.Id.Value);
}
return string.Empty;
}
}
}
Additionally, it looks like the ability to create a new solution from abp suite has been removed. Only the option to open an existing solution exists in abp suite version 9.1.
is there no way to create a solution with the lepton theme anymore? abp suite used to have the option to create a solution and chose the lepton theme (not leptonx or leptonxlite).
ABP Commercial 9.1.0 / Blazor Server / EF / Non tiered / Separate Host and Tenant DBs / Lepton Theme
Hi we are attempting to create a v7.4.2 newly templated solution so that we can compare it to version 9.1.0 and make necessary adjustments after a ABP upgrade.
The issue we are having is that we cannot seem to specify the Lepton theme in the abp new command, no matter what theme we specify, the solution gets created with the leptonxlite theme.
Our current production application uses the Lepton theme (not LeptonX or LeptonXLite). We have many custom css overrides based on the Lepton theme, so upgrading to LeptonX is not an option right now.
The command we are issuing is...
abp new ABPTemplate742 -t app -u blazor-server -d ef --theme lepton --mobile none -v 7.4.2
Please advise. Thank you in advance.
Thank you for your help maliming.
Once I cleared my cookies everything worked as expected.
Hi,
I was able to get the template solution to work and found that I could not replicate the two factor issue. So it is unclear to me why we are seeing the issue in our solution.
To debug, I overrode GetTwoFactorEnabledAsync
in the IdentityProUserStore
and found that when it runs, it correctly returns true
because the tenant's 2fa setting is set to forced.
Our override to the login process relative to 2fa is not changed from the original ABP implementation...
var result = await SignInManager.PasswordSignInAsync(
LoginInput.UserNameOrEmailAddress,
LoginInput.Password,
LoginInput.RememberMe,
true
);
await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext
{
Identity = IdentitySecurityLogIdentityConsts.Identity,
Action = result.ToIdentitySecurityLogAction(),
UserName = LoginInput.UserNameOrEmailAddress
});
if (result.RequiresTwoFactor)
{
return RedirectToPage("./SendSecurityCode", new {
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = LoginInput.RememberMe,
linkUserId = LinkUserId,
linkTenantId = LinkTenantId,
linkToken = LinkToken
});
}
result.RequiresTwoFactor
returned from await SignInManager.PasswordSignInAsync
returns false.
Hi
I emailed you a link to the project solution.
I used abp suite to create the application it is using Lepton theme at version 7.2.1. I ran install-libs from the ProjectName.Blazor folder.
{
"version": "1.0.0",
"name": "my-app",
"private": true,
"dependencies": {
"@volo/abp.aspnetcore.components.server.leptontheme": "7.2.1",
"@volo/abp.aspnetcore.mvc.ui.theme.lepton": "7.2.1",
"@volo/account": "~7.2.1",
"@volo/cms-kit-pro.admin": "~7.2.1",
"@volo/language-management": "~7.2.1"
}
}
I'm trying to create a new project from the template and I'm getting the following when clicking on the login link.. I already ran yarn and abp install-libs from the solution folder.
An unhandled exception occurred while processing the request. AbpException: Could not find the bundle file '/libs/bootstrap/js/bootstrap.enable.tooltips.everywhere.js' for the bundle 'Lepton.Global'! Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpTagHelperResourceService.ProcessAsync(ViewContext viewContext, TagHelper tagHelper, TagHelperContext context, TagHelperOutput output, List<BundleTagHelperItem> bundleItems, string bundleName)