Exemplo n.º 1
0
 public bool ResetUserPassword(ResetPasswordDto resetDto)
 {
     return(true);
 }
Exemplo n.º 2
0
 public async Task SendMailActivateAccountAsync(ResetPasswordDto dto)
 {
     await _oppJarProxy.SendMailActivateAccountAsync(dto);
 }
Exemplo n.º 3
0
 public async Task <HttpResponseMessage> SendMailForgotPasswordAsync(ResetPasswordDto dto)
 {
     return(await _oppJarProxy.SendMailForgotPasswordAsync(dto));
 }
Exemplo n.º 4
0
        public async Task <JsonResultModel <bool> > ResetPasswordAsync([FromBody] ResetPasswordDto input)
        {
            await _service.ResetPasswordAsync(input);

            return(true.ToSuccess());
        }
Exemplo n.º 5
0
 public async Task <ApiResponseDto> ResetPassword(ResetPasswordDto resetPasswordParameters)
 {
     return(await _httpClient.PostJsonAsync <ApiResponseDto>("api/Account/ResetPassword", resetPasswordParameters));
 }
Exemplo n.º 6
0
 public ResultObj ResetPassword(ResetPasswordDto resetPasswordModel)
 {
     throw new NotImplementedException();
 }
        public async Task <object> ResetPassword(ResetPasswordDto model)
        {
            var user = await _userManager.FindByEmailAsync(model.Email);

            return(_userManager.ResetPasswordAsync(user, model.Code, model.Password).Result.Succeeded);
        }
        public async Task <UnifyResponseDto> ResetPasswordAsync(long id, [FromBody] ResetPasswordDto resetPasswordDto)
        {
            await _userSevice.ResetPasswordAsync(id, resetPasswordDto);

            return(UnifyResponseDto.Success("密码修改成功"));
        }
Exemplo n.º 9
0
 public ResultDto ResetPassword(int id, [FromBody] ResetPasswordDto resetPasswordDto)
 {
     _userSevice.ResetPassword(id, resetPasswordDto);
     return(ResultDto.Success("密码修改成功"));
 }
Exemplo n.º 10
0
 public async Task <ApiResponse> ResetPassword(ResetPasswordDto parameters)
 => ModelState.IsValid ? await _accountManager.ResetPassword(parameters) : _invalidUserModel;
Exemplo n.º 11
0
        public async Task <ApiResponseDto> ResetPassword(ResetPasswordDto resetPasswordParameters)
        {
            HttpResponseMessage response = await _httpClient.PostAsJsonAsync("api/Account/ResetPassword", resetPasswordParameters);

            return(JsonConvert.DeserializeObject <ApiResponseDto>(await response.Content.ReadAsStringAsync()));
        }
Exemplo n.º 12
0
 public static void CopyFromEntity(ResetPasswordDto response, Driver driver)
 {
     //response.password_reset = driver.;
     //response.password_otp_sent = driver.;
 }
Exemplo n.º 13
0
        public ResponseModel ChangePwd([FromBody] ResetPasswordDto model)
        {
            var result = userService.ResetPwd(model.userId, model.password);

            return(result);
        }
        public async Task <IActionResult> ResetPassword([FromBody] ResetPasswordDto model)
        {
            if (ModelState.IsValid)
            {
                bool isEmail = Regex.IsMatch(model.Email, @"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z", RegexOptions.IgnoreCase);

                if (isEmail)
                {
                    ApplicationUser user = await _userManager.FindByEmailAsync(model.Email).ConfigureAwait(false);

                    if (user != null)
                    {
                        // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
                        // Send an email with this link
                        IdentityResult result = await _userManager.ResetPasswordAsync(user, model.Code, model.Password).ConfigureAwait(false);

                        if (result.Succeeded)
                        {
                            await _emailSender.SendEmailAsync(
                                user.Email,
                                "**Do Not Reply** NetAuthCore Password has been changed!",
                                "Your NetAuthCore password has been changed!").ConfigureAwait(false);

                            return(Ok(new RequestResult
                            {
                                State = RequestState.Success,
                                Msg = "Password has been successfully reset! Please login using the new password."
                            }));
                        }
                        else
                        {
                            return(BadRequest(new RequestResult
                            {
                                State = RequestState.Failed,
                                Msg = result.Errors.ToString()
                            }));
                        }
                    }

                    return(BadRequest(new RequestResult
                    {
                        State = RequestState.Failed,
                        Msg = "Error: User not found!"
                    }));
                }
                else
                {
                    return(BadRequest(new RequestResult
                    {
                        State = RequestState.Failed,
                        Msg = "Error: Email not valid!"
                    }));
                }
            }
            else
            {
                return(BadRequest(new RequestResult
                {
                    State = RequestState.Failed,
                    Msg = "Error: " + string.Join(" ", ModelState.Values.SelectMany(x => x.Errors).Select(x => x.ErrorMessage)),
                }));
            }
        }
Exemplo n.º 15
0
 /// <inheritdoc />
 public Task ResetPassword(ResetPasswordDto parameters)
 {
     return(_accountAppService.ResetPasswordAsync(parameters));
 }
Exemplo n.º 16
0
        public async Task <IActionResult> ResetPasswordAsync(ResetPasswordDto resetPasswordDto)
        {
            await _userCommandService.ResetPasswordAsync(resetPasswordDto);

            return(Ok());
        }
Exemplo n.º 17
0
        public async Task <IActionResult> ResetPassowrd(ResetPasswordDto resetPasswordDto)
        {
            await _businessServiceProvider.UserService.ResetPasswordAsync(resetPasswordDto);

            return(Ok());
        }
        private async Task <ContentResult> RenderResetPasswordResult(ResetPasswordDto dto)
        {
            var res = await _mailer.RenderAsync(new UserResetPasswordPage(dto));

            return(Content(res, "text/html"));
        }
 public Task ResetPasswordAsync(ResetPasswordDto resetPasswordDto)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 20
0
        public HttpResponseMessage ResetPassword(ResetPasswordDto model)
        {
            Response <AccountDto> response = loginProvider.PasswordReset(model, Request.GetOwinContext().Authentication);

            return(Request.CreateResponse <Response <AccountDto> >(HttpStatusCode.OK, response));
        }
Exemplo n.º 21
0
        public async Task ResetPassword(string userName, ResetPasswordDto dto)
        {
            var path = $"account/name/{userName}/resetpassword";

            await Api.Post <object>(path, dto);
        }
Exemplo n.º 22
0
 public IActionResult ResetPassword([FromBody] ResetPasswordDto data)
 {
     return(GetStatusCodeResult(_userService.ResetPassword(data)));
 }