2022-10-27 20:13:02 +03:00
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Web.Mvc;
|
2022-11-18 03:15:53 +03:00
|
|
|
using CodeLiturgy.Data.Auth.Context.Users;
|
2022-10-27 20:13:02 +03:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2022-10-30 19:48:24 +03:00
|
|
|
using CodeLiturgy.Views.Models;
|
|
|
|
using CodeLiturgy.Views.Utils;
|
2022-10-27 20:13:02 +03:00
|
|
|
|
2022-10-30 19:48:24 +03:00
|
|
|
namespace CodeLiturgy.Views.Controllers;
|
2022-10-27 20:13:02 +03:00
|
|
|
|
|
|
|
public class AccountController : UserController
|
|
|
|
{
|
2022-11-22 18:05:35 +03:00
|
|
|
public AccountController(
|
|
|
|
ApplicationUserManager userManager,
|
|
|
|
ILogger<AccountController> logger) : base(userManager, logger)
|
2022-10-27 20:13:02 +03:00
|
|
|
{
|
|
|
|
_userManager = userManager;
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
public async Task<IActionResult> Index()
|
|
|
|
{
|
|
|
|
await OnEveryAction();
|
|
|
|
var user = await GetLoggedInUser();
|
|
|
|
return View(user);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void OnInitialization()
|
|
|
|
{
|
2022-11-17 00:17:44 +03:00
|
|
|
SetFooterMenu(LayoutCache.AccountRouteRecord.ChildrenToUrl());
|
2022-10-27 20:13:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public async Task<IActionResult> Change()
|
|
|
|
{
|
|
|
|
await OnEveryAction();
|
|
|
|
return View("ChangePassword");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
2022-11-17 01:17:37 +03:00
|
|
|
public IActionResult Error()
|
2022-10-27 20:13:02 +03:00
|
|
|
{
|
|
|
|
return View(new ErrorViewModel {RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|