diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs index dc9a6102f88..8992ef062a2 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs @@ -3,6 +3,8 @@ using System.Linq; using System.Threading.Tasks; using JetBrains.Annotations; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; @@ -18,6 +20,8 @@ public class AppUrlProvider : IAppUrlProvider, ITransientDependency protected ICurrentTenant CurrentTenant { get; } protected ITenantStore TenantStore { get; } + public ILogger Logger { get; set; } + public AppUrlProvider( IOptions options, ICurrentTenant currentTenant, @@ -26,6 +30,7 @@ public AppUrlProvider( CurrentTenant = currentTenant; TenantStore = tenantStore; Options = options.Value; + Logger = NullLogger.Instance; } public virtual async Task GetUrlAsync(string appName, string urlName = null) @@ -40,7 +45,12 @@ await GetConfiguredUrl( public bool IsRedirectAllowedUrl(string url) { - return Options.RedirectAllowedUrls.Any(url.StartsWith); + var allow = Options.RedirectAllowedUrls.Any(url.StartsWith); + if (!allow) + { + Logger.LogError($"Invalid RedirectUrl: {url}, Use {nameof(AppUrlProvider)} to configure it!"); + } + return allow; } protected virtual async Task GetConfiguredUrl(string appName, string urlName)