protected virtual IActionResult RecoverPassword(RecoverPasswordRequest recoverPasswordRequest) { if (recoverPasswordRequest == null) { return(BadRequest()); } var loginResponse = PasswordRecoveryBusiness.RecoverPassword(recoverPasswordRequest.Code, recoverPasswordRequest.Password); return(Ok(new { jwt = GenerateToken(loginResponse.Email), data = loginResponse })); }
protected virtual async Task <IActionResult> ForgotPasswordAsync(ForgotPasswordRequest forgotPasswordRequest) { if (forgotPasswordRequest == null) { return(BadRequest()); } if (!IsValidRecaptcha(forgotPasswordRequest.Captcha)) { return(BadRequest(new { error = "Invalid Captcha." })); } await PasswordRecoveryBusiness.SendEmailForForgottenPasswordAsync(forgotPasswordRequest.Email); return(Ok()); }
public async Task SendEmailForForgottenPassword(string email) { await PasswordRecoveryBusiness.SendEmailForForgottenPassword(email); }
public void RecoverPassword(string code, string password) { PasswordRecoveryBusiness.RecoverPassword(code, password); }