feat: Add success alert after login (CAS-1) #19
@ -9,12 +9,21 @@ import { routes } from './app.routes';
|
||||
import {
|
||||
KeycloakAngularModule,
|
||||
KeycloakBearerInterceptor,
|
||||
KeycloakEventType,
|
||||
KeycloakService,
|
||||
} from 'keycloak-angular';
|
||||
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
export const initializeKeycloak = (keycloak: KeycloakService) => async () =>
|
||||
keycloak.init({
|
||||
export const initializeKeycloak = (keycloak: KeycloakService) => async () => {
|
||||
keycloak.keycloakEvents$.subscribe({
|
||||
next: (e: any) => {
|
||||
|
||||
if (e.type === KeycloakEventType.OnAuthSuccess) {
|
||||
alert('Login erfolreich');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
return await keycloak.init({
|
||||
config: {
|
||||
url: 'http://localhost:9090',
|
||||
realm: 'LF12',
|
||||
@ -28,6 +37,7 @@ export const initializeKeycloak = (keycloak: KeycloakService) => async () =>
|
||||
redirectUri: 'http://localhost:4200',
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
function initializeApp(keycloak: KeycloakService): () => Promise<boolean> {
|
||||
return () => initializeKeycloak(keycloak)();
|
||||
|
Loading…
x
Reference in New Issue
Block a user
never use any