<commit_before>import { Injectable } from '@angular/core';
import { CanActivate, Router } from '@angular/router';
import { AuthService } from './auth.service';


@Injectable()
export class AuthGuard implements CanActivate {

  constructor(
    private auth: AuthService, private router: Router) {}

  public canActivate(): boolean {
    return true;
  }<commit_msg>auth guard fix<commit_after>import { Injectable } from '@angular/core';
import { CanActivate, Router } from '@angular/router';
import { AuthService } from './auth.service';


@Injectable()
export class AuthGuard implements CanActivate {

  constructor(
    private auth: AuthService, private router: Router) {}

  public canActivate(): Promise<boolean> {
    return this.auth.isLoggedIn().then(result => {
      if (!result) {
         this.router.navigate(['/login']);
      }
      return result;
    });
  }
{'fraction_non_alphanumeric': 0.13142857142857142, 'fraction_numerical': 0.0, 'mean_word_length': 3.977272727272727, 'pattern_counts': {'":': 0, '<': 4, '<?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': '5316378', 'n_tokens_mistral': 254, 'n_tokens_neox': 248, 'n_words': 69}