'use strict';

var _                = require('lodash');
var Navigation       = require('react-router').Navigation;

var CurrentUserStore = require('../stores/CurrentUserStore');

var AuthenticatedRouteMixin = {

  mixins: [Navigation],

  componentDidUpdate: function() {
    if ( _.isEmpty(CurrentUserStore.user) && CurrentUserStore.hasBeenChecked && this.isMounted() ) {
      this.replaceWith('Home');
    }
  }

};

module.exports = AuthenticatedRouteMixin;
@@ -237,26 +237,24 @@
 %0A%0A  
-componentDidUpdate
+_checkIfRedirect
 : fu
@@ -401,14 +401,153 @@
 ');%0A
-
     %7D%0A
+  %7D,%0A%0A  componentDidMount: function() %7B%0A    this._checkIfRedirect();%0A  %7D,%0A%0A  componentDidUpdate: function() %7B%0A    this._checkIfRedirect();%0A
   %7D%0A

fix authenticated route mixin logic