<commit_before>import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default class AuthenticatedGithubRedirectRoute extends Route {
  @service ajax;
  @service('notifications') notify;
  @service organization;

  async beforeModel(transition){
    const token = encodeURIComponent(transition.queryParams.token);
    const url = `/api/organizations/${this.get('organization.selected.id')}/github`;
    try{
      let data = await this.get("ajax").post(url, {data:{token: token}})
      this.get("notify").success(`Successfully Integrated with user ${data.login}`);
    }catch(err){
      this.get("notify").error(`Error Occured: ${err.payload.message}`);
    }
  }

  afterModel(){
    return this.transitionTo('authenticated.organization.settings');
  }
}<commit_msg>Fixed deprecated api in accesssing queryParams<commit_after>import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default class AuthenticatedGithubRedirectRoute extends Route {
  @service ajax;
  @service('notifications') notify;
  @service organization;

  async beforeModel(transition) {
    const token = encodeURIComponent(transition.to.queryParams.token);
    const url = `/api/organizations/${this.get(
      'organization.selected.id'
    )}/github`;
    try {
      let data = await this.get('ajax').post(url, { data: { token: token } });
      this.get('notify').success(
        `Successfully Integrated with user ${data.login}`
      );
    } catch (err) {
      this.get('notify').error(`Error Occured: ${err.payload.message}`);
    }
  }

  afterModel() {
    return this.transitionTo('authenticated.organization.settings');
  }
}
{'fraction_non_alphanumeric': 0.14419695193434937, 'fraction_numerical': 0.0, 'mean_word_length': 4.204268292682927, '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': '6640109', 'n_tokens_mistral': 493, 'n_tokens_neox': 489, 'n_words': 108}