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

@Component({
    templateUrl: './admin.component.html'
})
export class AdminComponent {
    constructor(
        private router: Router) {}

    home(): void {
        this.router.navigate(['admin']);
    }

    adduser(): void {
        this.router.navigate(['adduser']);
    }
}<commit_msg>Fix admin logout<commit_after>import { Component } from '@angular/core';
import { Router } from '@angular/router';

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

@Component({
    templateUrl: './admin.component.html'
})
export class AdminComponent {
    constructor(
        private authService: AuthService,
        private router: Router) {}

    home(): void {
        this.router.navigate(['admin']);
    }

    adduser(): void {
        this.router.navigate(['adduser']);
    }

    logout(): void {
        this.authService.logout()
        .then(response => {
            if(response.success) {
                this.router.navigate(['login']);
            }
        });
    }
}
{'fraction_non_alphanumeric': 0.1577490774907749, 'fraction_numerical': 0.0, 'mean_word_length': 2.5, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2114856', 'n_tokens_mistral': 312, 'n_tokens_neox': 304, 'n_words': 63}