changed env variable name

This commit is contained in:
Timo Bejan 2020-09-22 13:49:04 +03:00
parent 4c3d282d41
commit 16df58d754
4 changed files with 12 additions and 15 deletions

View File

@ -7,7 +7,7 @@ import {Observable} from "rxjs";
export enum AppConfigKey {
KEYCLOAK_URL = "KEYCLOAK_URL",
KEYCLOAK_REALM = "KEYCLOAK_REALM",
KEYCLOAK_CLIENT_ID = "KEYCLOAK_CLIENT_ID",
API_CLIENT = "API_CLIENT",
API_URL = "API_URL",
}

View File

@ -1,7 +1,7 @@
import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {AppConfigService} from "../app-config/app-config.service";
import {AppConfigKey, AppConfigService} from "../app-config/app-config.service";
@Injectable()
export class ApiPathInterceptorService implements HttpInterceptor {
@ -11,16 +11,13 @@ export class ApiPathInterceptorService implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
// if (!req.url.startsWith('/assets')) {
// const updatedRequest = req.clone({
// url: this._appConfigService.getConfig(AppConfigKey.API_URL) + req.url
// })
//
// console.log(req);
//
// return next.handle(updatedRequest);
// } else {
return next.handle(req);
// }
if (!req.url.startsWith('/assets')) {
const updatedRequest = req.clone({
url: this._appConfigService.getConfig(AppConfigKey.API_URL) + req.url
})
return next.handle(updatedRequest);
} else {
return next.handle(req);
}
}
}

View File

@ -9,7 +9,7 @@ export function keycloakInitializer(keycloak: KeycloakService, appConfigService:
config: {
url: appConfigService.getConfig(AppConfigKey.KEYCLOAK_URL),
realm: appConfigService.getConfig(AppConfigKey.KEYCLOAK_REALM),
clientId: appConfigService.getConfig(AppConfigKey.KEYCLOAK_CLIENT_ID)
clientId: appConfigService.getConfig(AppConfigKey.API_CLIENT)
},
initOptions: {
checkLoginIframe: false,

View File

@ -1,6 +1,6 @@
{
"KEYCLOAK_URL": "https://keycloak-dev.iqser.cloud/auth",
"KEYCLOAK_REALM": "dev",
"KEYCLOAK_CLIENT_ID": "gin-client",
"API_CLIENT": "gin-client",
"API_URL": ""
}