2022-10-27 20:13:02 +03:00
|
|
|
|
using BlueWest.Data.Auth.Context.Users;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2022-09-26 04:05:23 +03:00
|
|
|
|
using BlueWest.Views.Utils;
|
2022-10-27 20:13:02 +03:00
|
|
|
|
using Duende.IdentityServer.Extensions;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
2022-09-26 04:05:23 +03:00
|
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
using Controller = Microsoft.AspNetCore.Mvc.Controller;
|
2022-09-19 05:50:15 +03:00
|
|
|
|
|
|
|
|
|
namespace BlueWest.Views.Controllers;
|
|
|
|
|
|
2022-09-26 04:05:23 +03:00
|
|
|
|
[System.Web.Mvc.Route("/")]
|
2022-10-27 20:13:02 +03:00
|
|
|
|
[System.Web.Mvc.Authorize]
|
|
|
|
|
public class HomeController : UserController
|
2022-09-19 05:50:15 +03:00
|
|
|
|
{
|
2022-10-27 20:13:02 +03:00
|
|
|
|
public HomeController(ApplicationUserManager userManager, ILogger<HomeController> logger) : base(userManager, logger)
|
2022-09-19 05:50:15 +03:00
|
|
|
|
{
|
2022-10-27 20:13:02 +03:00
|
|
|
|
_userManager = userManager;
|
2022-09-19 05:50:15 +03:00
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
2022-09-26 04:05:23 +03:00
|
|
|
|
|
2022-10-27 20:13:02 +03:00
|
|
|
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
public async Task<IActionResult> Index()
|
2022-09-19 05:50:15 +03:00
|
|
|
|
{
|
2022-10-27 20:13:02 +03:00
|
|
|
|
await OnEveryAction();
|
|
|
|
|
|
|
|
|
|
if (!User.IsAuthenticated())
|
|
|
|
|
{
|
|
|
|
|
return Redirect("/auth/login");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-09-19 05:50:15 +03:00
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-27 20:13:02 +03:00
|
|
|
|
|
|
|
|
|
|
2022-09-19 05:50:15 +03:00
|
|
|
|
}
|