dev env setup

This commit is contained in:
tw-blue
2025-12-06 21:27:29 +01:00
parent 987a380758
commit bc9f0f9f3b
38 changed files with 5953 additions and 733 deletions
@@ -1,4 +1,4 @@
import { effect, inject, Injectable, signal } from '@angular/core';
import { computed, effect, inject, Injectable, signal } from '@angular/core';
import {
KEYCLOAK_EVENT_SIGNAL,
KeycloakEventType,
@@ -22,6 +22,9 @@ export class Authentication {
private readonly _authenticationState = signal<AuthenticationState>(AuthenticationState.Unknown);
private readonly _userInfo = signal<KeycloakProfile | null>(null);
public readonly authenticationState = this._authenticationState.asReadonly();
public readonly loggedIn = computed(()=>{
return this.authenticationState() === AuthenticationState.Authenticated;
});
public readonly userInfo = this._userInfo.asReadonly();
public constructor() {
@@ -69,6 +72,10 @@ export class Authentication {
}
public async login(location?: string): Promise<void> {
if(this._authenticationState() === AuthenticationState.Authenticated){
return;
}
var redirectUri = location
? `${window.location.origin}/${location}`
: `${window.location.origin}/login`;