CodeLiturgy.Dashboard/CodeLiturgy.Views/Controllers/AccountController.cs

44 lines
1.1 KiB
C#

using System.Diagnostics;
using System.Web.Mvc;
using CodeLiturgy.Data.Auth.Context.Users;
using Microsoft.AspNetCore.Mvc;
using CodeLiturgy.Views.Models;
using CodeLiturgy.Views.Utils;
namespace CodeLiturgy.Views.Controllers;
public class AccountController : LoggedInUserController
{
public AccountController(
ApplicationUserManager userManager,
ILogger<AccountController> logger) : base(userManager, logger)
{
_userManager = userManager;
_logger = logger;
}
public async Task<IActionResult> Index()
{
await OnEveryAction();
var user = await GetLoggedInUser();
return View(user);
}
public override void OnInitialization()
{
SetFooterMenu(LayoutCache.AccountRouteRecord.ChildrenToUrl());
}
public async Task<IActionResult> Change()
{
await OnEveryAction();
return View("ChangePassword");
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel {RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier});
}
}