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:
@@ -2,9 +2,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using AutoMapper;
|
||||
using BlazorShared.Authorization;
|
||||
using MediatR;
|
||||
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@@ -28,6 +27,8 @@ namespace Microsoft.eShopWeb.PublicApi
|
||||
public class Startup
|
||||
{
|
||||
private const string CORS_POLICY = "CorsPolicy";
|
||||
public static bool InDocker => Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") == "true";
|
||||
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
@@ -128,8 +129,7 @@ namespace Microsoft.eShopWeb.PublicApi
|
||||
{
|
||||
builder.WithOrigins("http://localhost:44319",
|
||||
"https://localhost:44319",
|
||||
"http://localhost:44315",
|
||||
"https://localhost:44315");
|
||||
Constants.GetOriginWebUrl(InDocker));
|
||||
builder.AllowAnyMethod();
|
||||
builder.AllowAnyHeader();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user