mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
855 B
26 lines
855 B
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Volo.Abp.Account.Web.Modules.Account.Components.Toolbar.UserLoginLink;
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Toolbars;
|
|
using Volo.Abp.Users;
|
|
|
|
namespace Volo.Abp.Account.Web
|
|
{
|
|
public class AccountModuleToolbarContributor : IToolbarContributor
|
|
{
|
|
public virtual Task ConfigureToolbarAsync(IToolbarConfigurationContext context)
|
|
{
|
|
if (context.Toolbar.Name != StandardToolbars.Main)
|
|
{
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
if (!context.ServiceProvider.GetRequiredService<ICurrentUser>().IsAuthenticated)
|
|
{
|
|
context.Toolbar.Items.Add(new ToolbarItem(typeof(UserLoginLinkViewComponent)));
|
|
}
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
}
|
|
|