18 lines
501 B
TypeScript
18 lines
501 B
TypeScript
import { CommonModule } from '@angular/common';
|
|
import { Component } from '@angular/core';
|
|
import { Router, RouterModule } from '@angular/router';
|
|
import { AuthService } from '../../services/auth.service';
|
|
|
|
@Component({
|
|
selector: 'logout',
|
|
standalone: true,
|
|
imports: [CommonModule, RouterModule],
|
|
template: ``,
|
|
})
|
|
export class LogoutComponent {
|
|
constructor(private authService: AuthService, private router: Router) {
|
|
this.authService.logout();
|
|
this.router.navigate(['/home']);
|
|
}
|
|
}
|