Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/669#discussion_r72946275
  
    --- Diff: app/addons/auth/actions.js ---
    @@ -28,88 +28,133 @@ var errorHandler = function (xhr, type, msg) {
     };
     
     
    -export default {
    +function login (username, password, urlBack) {
    +  var promise = FauxtonAPI.session.login(username, password);
    +
    +  promise.then(function () {
    +    FauxtonAPI.addNotification({ msg: FauxtonAPI.session.messages.loggedIn 
});
    +    if (urlBack) {
    +      return FauxtonAPI.navigate(urlBack);
    +    }
    +    FauxtonAPI.navigate('/');
    +  });
    +  promise.fail(errorHandler);
    +}
     
    -  login: function (username, password, urlBack) {
    -    var promise = FauxtonAPI.session.login(username, password);
    +function changePassword (password, passwordConfirm) {
    +  var nodes = nodesStore.getNodes();
    +  var promise = FauxtonAPI.session.changePassword(password, 
passwordConfirm, nodes[0].node);
     
    -    promise.then(function () {
    -      FauxtonAPI.addNotification({ msg: 
FauxtonAPI.session.messages.loggedIn });
    -      if (urlBack) {
    -        return FauxtonAPI.navigate(urlBack);
    -      }
    -      FauxtonAPI.navigate('/');
    -    });
    -    promise.fail(errorHandler);
    -  },
    +  promise.then(() => {
    +    FauxtonAPI.addNotification({ msg: 
FauxtonAPI.session.messages.changePassword });
    +    FauxtonAPI.dispatch({ type: ActionTypes.AUTH_CLEAR_CHANGE_PWD_FIELDS 
});
    +  });
     
    -  changePassword: function (password, passwordConfirm) {
    -    var nodes = nodesStore.getNodes();
    -    var promise = FauxtonAPI.session.changePassword(password, 
passwordConfirm, nodes[0].node);
    +  promise.fail(errorHandler);
    --- End diff --
    
    We mustn't use `promise.fail` we cant to eventually move away from jquery 
and use something else. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to