using MemberCenter.Infrastructure.Identity; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; namespace MemberCenter.Web.Controllers; [Authorize] public class ProfileController : Controller { private readonly UserManager _userManager; public ProfileController(UserManager userManager) { _userManager = userManager; } [HttpGet] public async Task Index() { var user = await _userManager.GetUserAsync(User); if (user is null) { return RedirectToAction("Login", "Account"); } return View(user); } }