using BlueWest.Data.Auth.Context.Users; using Microsoft.AspNetCore.Mvc; using CodeLiturgy.Views.Utils; using Duende.IdentityServer.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.Options; using Controller = Microsoft.AspNetCore.Mvc.Controller; namespace CodeLiturgy.Views.Controllers; [System.Web.Mvc.Route("/")] [System.Web.Mvc.Authorize] public class HomeController : UserController { public HomeController(ApplicationUserManager userManager, ILogger logger) : base(userManager, logger) { _userManager = userManager; _logger = logger; } public override void OnInitialization() { var menu = LayoutCache.Root.ChildrenToUrl(); SetHeaderMenu(menu); } [AllowAnonymous] public async Task Index() { await OnEveryAction(); if (!User.IsAuthenticated()) { return Redirect("/auth/login"); } return View(); } }