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:
@@ -7,14 +7,14 @@ namespace Microsoft.eShopWeb.Web.Configuration
|
||||
{
|
||||
public static class ConfigureCookieSettings
|
||||
{
|
||||
public static void Configure(IServiceCollection services)
|
||||
public static IServiceCollection AddCookieSettings(this IServiceCollection services)
|
||||
{
|
||||
services.Configure<CookiePolicyOptions>(options =>
|
||||
{
|
||||
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
|
||||
//TODO need to check that.
|
||||
//options.CheckConsentNeeded = context => true;
|
||||
options.MinimumSameSitePolicy = SameSiteMode.None;
|
||||
options.MinimumSameSitePolicy = SameSiteMode.Strict;
|
||||
});
|
||||
services.ConfigureApplicationCookie(options =>
|
||||
{
|
||||
@@ -27,6 +27,8 @@ namespace Microsoft.eShopWeb.Web.Configuration
|
||||
IsEssential = true // required for auth to work without explicit user consent; adjust to suit your privacy policy
|
||||
};
|
||||
});
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Microsoft.eShopWeb.Web.Configuration
|
||||
{
|
||||
public static class ConfigureCoreServices
|
||||
{
|
||||
public static void Configure(IServiceCollection services, IConfiguration configuration)
|
||||
public static IServiceCollection AddCoreServices(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddScoped(typeof(IAsyncRepository<>), typeof(EfRepository<>));
|
||||
services.AddScoped<IBasketService, BasketService>();
|
||||
@@ -19,6 +19,8 @@ namespace Microsoft.eShopWeb.Web.Configuration
|
||||
services.AddSingleton<IUriComposer>(new UriComposer(configuration.Get<CatalogSettings>()));
|
||||
services.AddScoped(typeof(IAppLogger<>), typeof(LoggerAdapter<>));
|
||||
services.AddTransient<IEmailSender, EmailSender>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Microsoft.eShopWeb.Web.Configuration
|
||||
{
|
||||
public static class ConfigureWebServices
|
||||
{
|
||||
public static void Configure(IServiceCollection services, IConfiguration configuration)
|
||||
public static IServiceCollection AddWebServices(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddMediatR(typeof(BasketViewModelService).Assembly);
|
||||
services.AddScoped<IBasketViewModelService, BasketViewModelService>();
|
||||
@@ -16,6 +16,8 @@ namespace Microsoft.eShopWeb.Web.Configuration
|
||||
services.AddScoped<ICatalogItemViewModelService, CatalogItemViewModelService>();
|
||||
services.Configure<CatalogSettings>(configuration);
|
||||
services.AddScoped<ICatalogViewModelService, CachedCatalogViewModelService>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user