public async Task <IHttpActionResult> ResetPasswordResponse([FromUri] string id, [FromUri] string token, [FromBody] NewPassword newPassword) { //throws 400 var validator = new NewPasswordValidator(); validator.ValidateAndThrow(newPassword); await _service.ResetPasswordAsync(id, token, newPassword.Password); return(StatusCode(HttpStatusCode.NoContent)); }
// ctor public EditProfileViewModel(ProfileModel _profile) { // Property Profile = _profile; Account = new Auth(Constants.FirebaseApiKey); ValidationRules = new ProfileValidator(); EmailValidators = new NewEmailValidator(); NewEmail = new NewEmailModel(); PasswordValidator = new NewPasswordValidator(); NewPassword = new NewPasswordModel(); // Command PutCommand = new Command(Put); ChangePasswordCommand = new Command(ChangePassword); BrowsePhotoCommad = new Command(BrowsePhoto); ChangeEmailCommand = new Command(ChangeEmail); }
public IHttpActionResult newPassword(NewPasswordValidator np) { if (np == null) { throw new HttpResponseException(HttpStatusCode.BadRequest); } GestorValidarPassword gVPassword = new GestorValidarPassword(); bool isCredentialValid = gVPassword.validarTokenEmail(np); if (isCredentialValid) { //Modificar contraseña y resetear el token gVPassword.modificarPassword(np); string exito = "Password modificado con exito."; return(Ok(exito)); } else { return(Unauthorized()); } }