Example #1
0
        [Route("ResetPassword")] // Confirm Reset Password - Should be reaching here from email.
        public async Task <IActionResult> ResetPassword(string username, string authCode)
        {
            ResultsItem pwResetAuthResult = await AuthorizationLogic.AuthorizeResetPassword(username, authCode);

            if (pwResetAuthResult.IsSuccess)
            {
                PasswordUpdateRequest request = new PasswordUpdateRequest
                {
                    Username           = username,
                    EmailAuthCode      = authCode,
                    AuthenticationHash = Utilities.GenerateHmacSHA256Hash($"{username}{authCode}_ptpwresetreq", "PTPWRESET")
                };
                TempData["ResetPasswordRequest"] = Utilities.Serialize(request);

                return(View("ExecutePasswordReset", request));
            }

            return(Content(pwResetAuthResult.Message));
        }