argos/dmp-frontend/src/app/ui/auth/logout/logout.component.ts

28 lines
777 B
TypeScript
Raw Normal View History

2023-10-11 16:53:12 +02:00
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService } from '@app/core/services/auth/auth.service';
import { KeycloakService } from 'keycloak-angular';
@Component({
templateUrl: "./logout.component.html",
styleUrls: ["./logout.component.scss"],
})
export class LogoutComponent implements OnInit {
constructor(
private keycloak: KeycloakService,
private authService: AuthService,
) {}
ngOnInit() {
this.authService.clear();
this.keycloak.logout(location.origin).then(() => {
localStorage.clear();
// this.router.navigate(['./'], { replaceUrl: true });
});
// this.tokenService.logout(() => {
// localStorage.clear();
// this.router.navigate(["./"], { replaceUrl: true });
// });
}
}