Base solution for your next web application
Open Closed

Reset Password Form error. #3519


User avatar
0
velu created
  1. When I use UserFriendlyException In AccountController.cs (Reset Password ActionResult) is shows error instead of Popup.

Please suggest me necessary changes for this bug.

[https://drive.google.com/file/d/0BzSirtYGe7EHU0Z4bFEtZkV2RGs/view?usp=sharing])

var user = await _userManager.GetUserByIdAsync(userId);
            if (user == null || user.PasswordResetCode.IsNullOrEmpty() || user.PasswordResetCode != model.ResetCode)
            {
          Error --->      throw new UserFriendlyException(L("InvalidPasswordResetCode"), L("InvalidPasswordResetCode_Detail"));
            }

            //Check Password History
            var passwordHistory = await _PassWordHistoryRepository.CheckLastPassword(model.Password, tenantId , userId);
            if (passwordHistory.Isexist)
            {
               Error --->   throw new UserFriendlyException("Your password is matching with \n the last " + passwordHistory.controlValue + " history password.");
            }

1 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    hi

    first of all reset password is not ajax method. aspnetboilerplate framework handles user friendly exceptions for non-ajax methods as well. you are seeing the developer error page because you have not configured CustomerErrors Mode = On after you set custom errors on, you can see a friendly ui.

    Please read handling exceptions for more information: <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Handling-Exceptions">https://aspnetboilerplate.com/Pages/Doc ... Exceptions</a>

    <configuration>
        <system.web>
            <customErrors mode="On"/>
        </system.web>
    </configuration>