From badc521fb3c2eeb56bd2ef53f67e8cd80839e4f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 14 Jun 2021 10:40:16 +0300 Subject: [PATCH] Handle validation errors on reset password. --- .../Pages/Account/ResetPassword.cshtml.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/ResetPassword.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/ResetPassword.cshtml.cs index 6aed769f76..44317eaaa5 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/ResetPassword.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/ResetPassword.cshtml.cs @@ -63,10 +63,10 @@ namespace Volo.Abp.Account.Web.Pages.Account public virtual async Task OnPostAsync() { - ValidateModel(); - try { + ValidateModel(); + await AccountAppService.ResetPasswordAsync( new ResetPasswordDto { @@ -87,6 +87,10 @@ namespace Volo.Abp.Account.Web.Pages.Account throw; } + catch (AbpValidationException e) + { + return Page(); + } //TODO: Try to automatically login! return RedirectToPage("./ResetPasswordConfirmation", new