<commit_before>import Ember from 'ember';

export default Ember.Route.extend({
  beforeModel: function() {
    var self = this;
    if (this.session.get('isLoggedIn') &&
        this.session.get('currentUser') === null) {
      return Ember.$.getJSON('/me').then(function(d) {
        self.session.set('currentUser', d.user);
      }).fail(function() {
        self.session.logoutUser();
      });
    }
  },

  actions: {
    didTransition: function() {
      this.controllerFor('application').stepFlash();
    },
  },
});<commit_msg>Use ic-ajax for catch()<commit_after>import Ember from 'ember';
import ajax from 'ic-ajax';

export default Ember.Route.extend({
  beforeModel: function() {
    var self = this;
    if (this.session.get('isLoggedIn') &&
        this.session.get('currentUser') === null) {
      return ajax('/me').then(function(d) {
        self.session.set('currentUser', d.user);
      }).catch(function() {
        self.session.logoutUser();
      });
    }
  },

  actions: {
    didTransition: function() {
      this.controllerFor('application').stepFlash();
    },
  },
});
{'fraction_non_alphanumeric': 0.18214936247723132, 'fraction_numerical': 0.0, 'mean_word_length': 2.925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4006022', 'n_tokens_mistral': 349, 'n_tokens_neox': 342, 'n_words': 59}