<commit_before>const debug = require('debug')('yunity:component:loginPage');

export default class LoginPageCtrl {

  constructor(yAPI, yChat, $location) {
    'ngInject';
    Object.assign(this, {
      yAPI, yChat, $location,
      data: {
        email: '',
        password: ''
      }
    });

  }

  login() {
    return this.yAPI.authenticate(Object.assign({
      success: (res) => {
        debug('login success');
        this.$location.path('/profile/' + res.data.user.id);
        this.yChat.initChats();
      },
      error: (err) => {
        debug('login failed', err);
      }
    }, this.data));
  }

}<commit_msg>Fix loginPageCtrl still using "yChat"<commit_after>const debug = require('debug')('yunity:component:loginPage');

export default class LoginPageCtrl {

  constructor(yAPI, yConversation, $location) {
    'ngInject';
    Object.assign(this, {
      yAPI, yConversation, $location,
      data: {
        email: '',
        password: ''
      }
    });

  }

  login() {
    return this.yAPI.authenticate(Object.assign({
      success: (res) => {
        debug('login success');
        this.$location.path('/profile/' + res.data.user.id);
        this.yConversation.initChats();
      },
      error: (err) => {
        debug('login failed', err);
      }
    }, this.data));
  }

}
{'fraction_non_alphanumeric': 0.1676829268292683, 'fraction_numerical': 0.0, 'mean_word_length': 2.392764857881137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3731526', 'n_tokens_mistral': 421, 'n_tokens_neox': 413, 'n_words': 72}