From 12ecc78a1818e5a5e644c5b727657dee5c43d165 Mon Sep 17 00:00:00 2001 From: etomas Date: Fri, 10 Mar 2017 21:51:48 +0100 Subject: [PATCH] Solves #112 --- docker-compose.prod.yml | 16 ++++++++-------- .../shared/services/configuration.service.ts | 2 +- .../modules/shared/services/security.service.ts | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 89917a056..7132c52d6 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -23,7 +23,7 @@ services: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5101 - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word - - ExternalCatalogBaseUrl=http://192.168.88.248:5101 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. + - ExternalCatalogBaseUrl=http://${ESHOP_EXTERNAL_IP}:5101 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. ports: - "5101:5101" @@ -31,9 +31,9 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5105 - - SpaClient=http://192.168.88.248:5104 + - SpaClient=http://${ESHOP_EXTERNAL_IP}:5104 - ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word - - MvcClient=http://192.168.88.248:5100 #Local: You need to open your host's firewall at range 5100-5105. + - MvcClient=http://${ESHOP_EXTERNAL_IP}:5100 #Local: You need to open your host's firewall at range 5100-5105. ports: - "5105:5105" @@ -50,10 +50,10 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5104 - - CatalogUrl=http://192.168.88.248:5101 - - OrderingUrl=http://192.168.88.248:5102 - - IdentityUrl=http://192.168.88.248:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. - - BasketUrl=http://192.168.88.248:5103 + - CatalogUrl=http://${ESHOP_EXTERNAL_IP}:5101 + - OrderingUrl=http://${ESHOP_EXTERNAL_IP}:5102 + - IdentityUrl=http://${ESHOP_EXTERNAL_IP}:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. + - BasketUrl=http://${ESHOP_EXTERNAL_IP}:5103 ports: - "5104:5104" @@ -63,7 +63,7 @@ services: - ASPNETCORE_URLS=http://0.0.0.0:5100 - CatalogUrl=http://catalog.api:5101 - OrderingUrl=http://ordering.api:5102 - - IdentityUrl=http://192.168.88.248:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. + - IdentityUrl=http://${ESHOP_EXTERNAL_IP}:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. - BasketUrl=http://basket.api:5103 ports: - "5100:5100" diff --git a/src/Web/WebSPA/Client/modules/shared/services/configuration.service.ts b/src/Web/WebSPA/Client/modules/shared/services/configuration.service.ts index bfe672e5e..6921fd167 100644 --- a/src/Web/WebSPA/Client/modules/shared/services/configuration.service.ts +++ b/src/Web/WebSPA/Client/modules/shared/services/configuration.service.ts @@ -22,7 +22,7 @@ export class ConfigurationService { constructor(private http: Http, private storageService: StorageService) { } load() { - let url = "http://localhost:5104/Home/Configuration"; + let url = "/Home/Configuration"; this.http.get(url).subscribe((response: Response) => { console.log('server settings loaded'); this.serverSettings = response.json(); diff --git a/src/Web/WebSPA/Client/modules/shared/services/security.service.ts b/src/Web/WebSPA/Client/modules/shared/services/security.service.ts index 47e70a60a..a0663a366 100644 --- a/src/Web/WebSPA/Client/modules/shared/services/security.service.ts +++ b/src/Web/WebSPA/Client/modules/shared/services/security.service.ts @@ -67,7 +67,7 @@ export class SecurityService { this.storage.store('userData', data); // emit observable this.authenticationSource.next(true); - window.location.href = 'http://localhost:5104'; + window.location.href = location.origin; }, error => this.HandleError(error), () => { @@ -80,7 +80,7 @@ export class SecurityService { let authorizationUrl = this.authorityUrl + '/connect/authorize'; let client_id = 'js'; - let redirect_uri = 'http://localhost:5104/'; + let redirect_uri = location.origin + '/'; let response_type = 'id_token token'; let scope = 'openid profile orders basket'; let nonce = 'N' + Math.random() + '' + Date.now(); @@ -152,7 +152,7 @@ export class SecurityService { public Logoff() { let authorizationUrl = this.authorityUrl + '/connect/endsession'; let id_token_hint = this.storage.retrieve('authorizationDataIdToken'); - let post_logout_redirect_uri = 'http://localhost:5104/'; + let post_logout_redirect_uri = location.origin + '/'; let url = authorizationUrl + '?' +