diff --git a/src/app/account.service.ts b/src/app/account.service.ts index 140d651d5850156939dc292f1056e36912964336..b36989abd730e5d207a08aabe5142153ae1d60b8 100644 --- a/src/app/account.service.ts +++ b/src/app/account.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@angular/core'; +import {Injectable, OnDestroy, OnInit} from '@angular/core'; import {MessageService} from "./message.service"; import {HttpClient, HttpErrorResponse, HttpHeaders} from "@angular/common/http"; import {map, Observable, of, tap, throwError} from 'rxjs'; @@ -9,10 +9,19 @@ import { environment } from '../environments/environment'; @Injectable({ providedIn: 'root' }) -export class AccountService { +export class AccountService implements OnInit { constructor(public messageService: MessageService, private http: HttpClient) { } + + ngOnInit() { + this.logHeader = "[AccountService:ngOnInit()] "; + this.messageService.add(this.logHeader + "\n keycloakURL: " + environment.keycloakURL + + "\n apiURL : " + environment.apiURL + + "\n secureRoute: " + environment.secureRoute + "\n"); + + // this.messageService.add(this.logHeader + 'Initial call to isAuthenticated: ' + this.isAuthenticated); + } private logHeader = '' private apiURL = environment.apiURL; 'http://localhost:8080/api'; diff --git a/src/app/auth-config.module.ts b/src/app/auth-config.module.ts index 2380ed615464417e3b9abc3f77e74458dee819c3..37c45b1cafb672be623c11bdf72aeebac21a8603 100644 --- a/src/app/auth-config.module.ts +++ b/src/app/auth-config.module.ts @@ -24,8 +24,8 @@ import { environment } from '../environments/environment'; renewTimeBeforeTokenExpiresInSeconds: 10, // startCheckSession: true, ignoreNonceAfterRefresh: true, - // routes that get added a bearer token by HTTP_INTERCEPTORS provided by angular-auth-oidc-client' - secureRoutes: ['http://localhost:8080'] + // routes that get added a bearer token by HTTP_INTERCEPTORS provided by angular-auth-oidc-client lib' + secureRoutes: [ environment.secureRoute ] }, }), ], diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index e9942296c8c90fb2a21a9b2e6b6b065b9c7ad194..e1f3b1b75ce9e25affeea1bdd9aaaf3b29be66a6 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -2,6 +2,6 @@ export const environment = { production: true, //keycloakURL: 'https://kube-master-h1.informatik.fh-nuernberg.de:/auth/', keycloakURL: '/auth/', - apiURL: '/api' + apiURL: 'https://kube-master-h1.informatik.fh-nuernberg.de:/api' }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 40e15592b9dc81ce37aedad89b4d29a98ceda799..071aea23f4bf758d98ed4aa8e95b32b394d41991 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,10 +5,11 @@ export const environment = { production: false, - // keycloakURL: 'http://localhost:8280/auth/' + keycloakURL: 'http://localhost:8280/auth/', // keycloakURL: '/auth/', - keycloakURL: 'https://kube-master-h1.informatik.fh-nuernberg.de:/auth/', - apiURL: 'http://localhost:8080/api' + // keycloakURL: 'https://kube-master-h1.informatik.fh-nuernberg.de:/auth/', + apiURL: 'http://localhostxx:8080/api', + secureRoute: 'http://localhost:8080/' }; /*