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

    https://github.com/apache/couchdb-fauxton/pull/833#discussion_r96420470
  
    --- Diff: app/core/auth.js ---
    @@ -11,50 +11,30 @@
     // the License.
     
     import FauxtonAPI from "./base";
    -import Backbone from "backbone";
    -import _ from "lodash";
     
    -// This is not exposed externally as it should not need to be accessed or 
overridden
    -var Auth = function (options) {
    -  this._options = options;
    -  this.initialize.apply(this, arguments);
    -};
    -
    -// Piggy-back on Backbone's self-propagating extend function,
    -Auth.extend = Backbone.Model.extend;
    -
    -_.extend(Auth.prototype, Backbone.Events, {
    -  authDeniedCb: function () {},
    -
    -  initialize: function () {
    -  },
    -
    -  authHandlerCb : function () {
    -    var deferred = $.Deferred();
    -    deferred.resolve();
    -    return deferred;
    -  },
    -
    -  registerAuth: function (authHandlerCb) {
    -    this.authHandlerCb = authHandlerCb;
    -  },
    -
    -  registerAuthDenied: function (authDeniedCb) {
    -    this.authDeniedCb = authDeniedCb;
    -  },
    +function authenticate(session, roles) {
    +  if (session.isAdminParty()) {
    +    return session.trigger('authenticated');
    --- End diff --
    
    if you are going to return in each if statement, you don't need the else. 
You can also make the `else if` just its own if statement


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to