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