diff --git a/WebAPI/Controllers/LayersController.cs b/WebAPI/Controllers/LayersController.cs index d948caa..ae58793 100644 --- a/WebAPI/Controllers/LayersController.cs +++ b/WebAPI/Controllers/LayersController.cs @@ -132,7 +132,7 @@ namespace WebAPI.Controllers [AllowAnonymous] public IActionResult AutoImport(string apiKey) { - if (Request.Host.Value != "localhost:5400" || apiKey != configuration["apiKey"]) + if (Request.Host.Value != configuration["api-local-url"] || apiKey != configuration["apiKey"]) { return Unauthorized(); } @@ -180,7 +180,7 @@ namespace WebAPI.Controllers [AllowAnonymous] public IActionResult autoImportMorska(string apiKey) { - if (Request.Host.Value != "localhost:5401" || apiKey != configuration["apiKey"]) + if (Request.Host.Value != configuration["api-local-url"] || apiKey != configuration["apiKey"]) { return Unauthorized(); } diff --git a/WebAPI/appsettings.Development.json b/WebAPI/appsettings.Development.json index 17f1e5e..a797a68 100644 --- a/WebAPI/appsettings.Development.json +++ b/WebAPI/appsettings.Development.json @@ -15,6 +15,7 @@ "apiKey": "10763478CB738D4ecb2h76g803478CB738D4e", "exportDirectory": "1eTyCUzYbzVQB8f8sbNmvnebFXyW2-axt", "appLogsFile": "1RL-qtl0THgBUWcEWWqc0nCaVY7c8RRfXk6uhsqczuVA", + "apiLocalUrl": "localhost:5401", "Kestrel": { "Endpoints": { "Http": { diff --git a/WebAPI/appsettings.json b/WebAPI/appsettings.json index 0922242..900c42f 100644 --- a/WebAPI/appsettings.json +++ b/WebAPI/appsettings.json @@ -15,6 +15,7 @@ "apiKey": "#{api-key}#", "exportDirectory": "#{export-directory}#", "appLogsFile": "#{app-logs-file}#", + "apiLocalUrl": "#{api-local-url}#", "Kestrel": { "Endpoints": { "Http": {