Docker Fix (#431)

* static added to Constants

* Docker support for Blazor

* GetHttp, PostHttp, ... inside AuthService, Docker working with login, Cookies Configuration temporary disabled

* BaseAddress get web uri from Blazor Shared.

* cookie options changed to fix docker.

* Fixed returnUrl when inserting admin link and navigate without login

* Functions not used removed.

* AddPolicy using GetWebUrl

* Login link removed from NavMenu

* Change ConfigureCookieSettings, ConfigureCoreServices and ConfigureWebServices to be IServiceCollection extentions.

* GetOriginWebUrl added.

* Auto InDocker switch added.

* Removed not used using .
This commit is contained in:
Shady Nagy
2020-07-27 15:06:18 +02:00
committed by GitHub
parent e1f9ddd192
commit 688064199d
25 changed files with 172 additions and 215 deletions

View File

@@ -1,14 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BlazorShared.Authorization
namespace BlazorShared.Authorization
{
public class Constants
public static class Constants
{
public static class Roles
{
public const string ADMINISTRATORS = "Administrators";
}
public static string GetApiUrl(bool inDocker) =>
inDocker ? DOCKER_API_URL : API_URL;
public static string GetWebUrl(bool inDocker) =>
inDocker ? DOCKER_WEB_URL : WEB_URL;
public static string GetOriginWebUrl(bool inDocker) =>
GetWebUrl(inDocker).TrimEnd('/');
private const string API_URL = "https://localhost:5099/api/";
private const string DOCKER_API_URL = "http://localhost:5200/api/";
private const string WEB_URL = "https://localhost:44315/";
private const string DOCKER_WEB_URL = "http://localhost:5106/";
}
}