<commit_before>import { Component, Inject, Input, OnInit, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { MatDialog, MAT_DIALOG_DATA } from '@angular/material';

import { AuthService } from '../shared/auth.service';

import { Paths } from '../shared/paths';

@Component({
  selector: 'auth-callback',
  template: '',
})
export class OAuthCallbackComponent implements OnInit, OnDestroy {
  param_sub: any;

  constructor(
    private route: ActivatedRoute,
    private router: Router,
    private authService: AuthService,
  ) { }

  ngOnInit() {
    this.param_sub = this.route.queryParams.subscribe(params => {
      if (params['code'] !== undefined) {
        this.authService.callback(params['code']);
        this.authService.login();
        this.router.navigate([Paths.Index]);
      }
    });
  }

  ngOnDestroy() {
    this.param_sub.unsubscribe();
  }
}

@Component({
  selector: 'auth',
  templateUrl: './auth.component.html',
  styleUrls: ['./auth.component.css'],
})
export class AuthComponent {
  constructor(
    @Inject(MAT_DIALOG_DATA) private data: any,
    private authService: AuthService,
    private dialog: MatDialog
  ) { }

  isFirstRun(): boolean {
    return this.data.firstRun;
  }

  actionLogin(): void {
    this.authService.initiateLogin();
  }
}
<commit_msg>Callback to last stored route in sessionService<commit_after>import { Component, Inject, Input, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { MatDialog, MAT_DIALOG_DATA } from '@angular/material';

import { AuthService } from '../shared/auth.service';
import { SessionService } from '../shared/session.service';

import { Paths } from '../shared/paths';

@Component({
  selector: 'auth-callback',
  template: '',
})
export class OAuthCallbackComponent implements OnInit, OnDestroy {
  param_sub: any;

  constructor(
    private route: ActivatedRoute,
    private sessionService: SessionService,
    private authService: AuthService,
  ) { }

  ngOnInit() {
    this.param_sub = this.route.queryParams.subscribe(params => {
      if (params['code'] !== undefined) {
        this.authService.callback(params['code']);
        this.authService.login();
        this.sessionService.onReady().subscribe(
          () => {
            this.sessionService.navigateToStoredRoute();
          }
        );
      }
    });
  }

  ngOnDestroy() {
    this.param_sub.unsubscribe();
  }
}

@Component({
  selector: 'auth',
  templateUrl: './auth.component.html',
  styleUrls: ['./auth.component.css'],
})
export class AuthComponent {
  constructor(
    @Inject(MAT_DIALOG_DATA) private data: any,
    private authService: AuthService,
    private dialog: MatDialog
  ) { }

  isFirstRun(): boolean {
    return this.data.firstRun;
  }

  actionLogin(): void {
    this.authService.initiateLogin();
  }
}

{'fraction_non_alphanumeric': 0.14186851211072665, 'fraction_numerical': 0.0, 'mean_word_length': 3.510140405616225, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '2747738', 'n_tokens_mistral': 878, 'n_tokens_neox': 869, 'n_words': 184}