diff --git a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Login.cshtml.cs b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Login.cshtml.cs index dacd7a5..0de1702 100644 --- a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Login.cshtml.cs +++ b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Login.cshtml.cs @@ -15,11 +15,15 @@ namespace Msn.InteropDemo.Web.Areas.Identity.Pages.Account [AllowAnonymous] public class LoginModel : PageModel { + private readonly UserManager _userManager; private readonly SignInManager _signInManager; private readonly ILogger _logger; - public LoginModel(SignInManager signInManager, ILogger logger) + public LoginModel(UserManager userManager, + SignInManager signInManager, + ILogger logger) { + _userManager = userManager; _signInManager = signInManager; _logger = logger; } @@ -77,9 +81,22 @@ public async Task OnPostAsync(string returnUrl = null) var result = await _signInManager.PasswordSignInAsync(Input.UserName, Input.Password, Input.RememberMe, lockoutOnFailure: false); if (result.Succeeded) { + var sysUser = _userManager.FindByNameAsync(Input.UserName).Result; + if (sysUser != null) + { + if (string.IsNullOrWhiteSpace(sysUser.Email) || !sysUser.CUIT.HasValue) + { + return RedirectToPage("Manage/Index", new { mustCongifAccount = true }); + } + } + _logger.LogInformation("User logged in."); return LocalRedirect(returnUrl); } + + + + //if (result.RequiresTwoFactor) //{ // return RedirectToPage("./LoginWith2fa", new { ReturnUrl = returnUrl, RememberMe = Input.RememberMe }); diff --git a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml index 64c6ab9..f697626 100644 --- a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml +++ b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml @@ -6,7 +6,14 @@ }

@ViewData["Title"]

+ +@if ((bool)ViewData["MustCongifAccount"]) +{ + +} + +
diff --git a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs index e3a96ae..a8f2270 100644 --- a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs +++ b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs @@ -55,8 +55,10 @@ public class InputModel public string CUIT { get; set; } } - public async Task OnGetAsync() + public async Task OnGetAsync(bool mustCongifAccount = false) { + ViewData.Add("MustCongifAccount", mustCongifAccount); + var user = await _userManager.GetUserAsync(User); if (user == null) { @@ -120,7 +122,7 @@ public async Task OnPostAsync() await _userManager.UpdateAsync(user); await _signInManager.RefreshSignInAsync(user); StatusMessage = "Su cuenta ha sido actualizada."; - return RedirectToPage(); + return RedirectToPage(new { mustCongifAccount = false }); } public async Task OnPostSendVerificationEmailAsync() diff --git a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/_MustConfigAccount.cshtml b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/_MustConfigAccount.cshtml new file mode 100644 index 0000000..17318fd --- /dev/null +++ b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/_MustConfigAccount.cshtml @@ -0,0 +1,5 @@ + + diff --git a/Msn.InteropDemo.Web/Views/Home/Index.cshtml b/Msn.InteropDemo.Web/Views/Home/Index.cshtml index d86f2e4..f9ff116 100644 --- a/Msn.InteropDemo.Web/Views/Home/Index.cshtml +++ b/Msn.InteropDemo.Web/Views/Home/Index.cshtml @@ -2,12 +2,11 @@ ViewData["Title"] = "Inicio"; } -

Open-RSD

Este es un proyecto educativo, que demuestra cómo un sistema se conecta con la Red de Salud Digital, parte de la Estrategia de Salud Digital de la República Argentina.

-

Open-RSD contiene las funcionalidades básicas de un Índice Maestro de Pacientes y un +

Open-RSD contiene las funcionalidades básicas de un Índice Maestro de Pacientes y una Historia clínica electrónica.

Puede descargar el código fuente del GitHub de la DNSIS Open-RSD

Ingresar »