<commit_before>import { Component } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'metrics-login',
  styleUrls: ['login.component.css'],
  template: `
    <div class="login">
      <h1>Login</h1>
      <p *ngIf="!errorMsg">You must login to use this app</p>
      <p *ngIf="errorMsg" class="error">{{errorMsg}}</p>
      <prx-login (success)="loginSuccess()" (failure)="loginFailure($event)">
      </prx-login>
    </div>
    `
})

export class LoginComponent {

  errorMsg: string;

  constructor(private router: Router) {}

  loginSuccess() {
    this.errorMsg = null;
    this.router.navigate(['/']);
  }

  loginFailure(reason: string) {<commit_msg>Reload on login success<commit_after>import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { CmsAccountAction, CmsPodcastsAction } from '../ngrx/actions';

@Component({
  selector: 'metrics-login',
  styleUrls: ['login.component.css'],
  template: `
    <div class="login">
      <h1>Login</h1>
      <p *ngIf="!errorMsg">You must login to use this app</p>
      <p *ngIf="errorMsg" class="error">{{errorMsg}}</p>
      <prx-login (success)="loginSuccess()" (failure)="loginFailure($event)">
      </prx-login>
    </div>
    `
})

export class LoginComponent {

  errorMsg: string;

  constructor(private router: Router, private store: Store<any>) {}

  loginSuccess() {
    this.errorMsg = null;
    this.store.dispatch(new CmsAccountAction());
    this.store.dispatch(new CmsPodcastsAction());
    this.router.navigate(['/']);
  }

  loginFailure(reason: string) {
{'fraction_non_alphanumeric': 0.1774390243902439, 'fraction_numerical': 0.0024390243902439024, 'mean_word_length': 3.8985074626865672, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, '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': '104978', 'n_tokens_mistral': 548, 'n_tokens_neox': 533, 'n_words': 113}