<commit_before>import Ember from 'ember';
import Base from 'ember-simple-auth/authenticators/base';
import Configuration from '../configuration';

const { get, isEmpty, inject: { service }, RSVP: { resolve, reject } } = Ember;

export default Base.extend({
  ajax: service(),

  init() {
    this._super(...arguments);
    this.serverTokenEndpoint = Configuration.serverTokenEndpoint;
    this.tokenAttributeName = Configuration.tokenAttributeName;
    this.identificationAttributeName = Configuration.identificationAttributeName;
  },

  restore(data) {
    const token = get(data, this.tokenAttributeName);
    if (!isEmpty(token)) {
      return resolve(data);
    } else {
      return reject();
    }
  },

  authenticate(data) {
    return get(this, 'ajax').post(this.serverTokenEndpoint, {
      contentType: 'application/json',
      data: JSON.stringify(data)
    }).then((response) => {
      return resolve(response);
    }).catch((error) => {
      Ember.Logger.warn(error);
      return reject();
    });
  }
});<commit_msg>remove catch from authentication ajax call<commit_after>import Ember from 'ember';
import Base from 'ember-simple-auth/authenticators/base';
import Configuration from '../configuration';

const { get, isEmpty, inject: { service }, RSVP: { resolve, reject } } = Ember;

export default Base.extend({
  ajax: service(),

  init() {
    this._super(...arguments);
    this.serverTokenEndpoint = Configuration.serverTokenEndpoint;
    this.tokenAttributeName = Configuration.tokenAttributeName;
    this.identificationAttributeName = Configuration.identificationAttributeName;
  },

  restore(data) {
    const token = get(data, this.tokenAttributeName);
    if (!isEmpty(token)) {
      return resolve(data);
    } else {
      return reject();
    }
  },

  authenticate(data) {
    return get(this, 'ajax').post(this.serverTokenEndpoint, {
      contentType: 'application/json',
      data: JSON.stringify(data)
    });
  }
});
{'fraction_non_alphanumeric': 0.13608562691131498, 'fraction_numerical': 0.0, 'mean_word_length': 3.7530266343825667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '790125', 'n_tokens_mistral': 560, 'n_tokens_neox': 544, 'n_words': 120}