refactor: Redirect to orginal route after login, restructure project files

This commit is contained in:
Phan Huy Tran 2025-02-13 10:29:13 +01:00 committed by Huy
commit 704cc22858
6 changed files with 20 additions and 12 deletions

View file

@ -0,0 +1,19 @@
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { KeycloakService } from 'keycloak-angular';
@Component({
selector: 'app-homepage',
standalone: true,
imports: [],
templateUrl: './home.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HomeComponent {
private keycloakService: KeycloakService = inject(KeycloakService);
logout() {
const baseUrl = window.location.origin;
this.keycloakService.logout(`${baseUrl}/`);
}
}