Add logout and login functionality
This commit is contained in:
parent
ad710e57f8
commit
e8d2f53a93
@ -1,4 +1,5 @@
|
|||||||
import {ChangeDetectionStrategy, Component} from '@angular/core';
|
import {ChangeDetectionStrategy, Component, inject} from '@angular/core';
|
||||||
|
import {KeycloakService} from "keycloak-angular";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-homepage',
|
selector: 'app-homepage',
|
||||||
@ -9,9 +10,10 @@ import {ChangeDetectionStrategy, Component} from '@angular/core';
|
|||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class HomepageComponent {
|
export class HomepageComponent {
|
||||||
|
private KeycloakService: KeycloakService = inject(KeycloakService);
|
||||||
|
|
||||||
onLogout() {
|
onLogout() {
|
||||||
//TODO implement
|
this.KeycloakService.logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
openUserInfo() {
|
openUserInfo() {
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
<button (click)="login()">Login</button>
|
@ -1,4 +1,5 @@
|
|||||||
import { Component } from '@angular/core';
|
import {Component, inject} from '@angular/core';
|
||||||
|
import {KeycloakService} from "keycloak-angular";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-landing-page',
|
selector: 'app-landing-page',
|
||||||
@ -7,5 +8,9 @@ import { Component } from '@angular/core';
|
|||||||
templateUrl: './landing-page.component.html',
|
templateUrl: './landing-page.component.html',
|
||||||
})
|
})
|
||||||
export class LandingPageComponent {
|
export class LandingPageComponent {
|
||||||
|
private keycloakService: KeycloakService = inject(KeycloakService);
|
||||||
|
|
||||||
|
login() {
|
||||||
|
this.keycloakService.login();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user