refactor: 设置网站Cookie Domain设置逻辑变更
#Comment 如果没有配置Domain,程序不设置Cookie Domain
This commit is contained in:
parent
49ab346d37
commit
3800ffc98a
|
@ -83,7 +83,7 @@ namespace Bootstrap.Admin
|
||||||
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options =>
|
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options =>
|
||||||
{
|
{
|
||||||
options.Cookie.Path = "/";
|
options.Cookie.Path = "/";
|
||||||
options.Cookie.Domain = Configuration["Domain"];
|
if (!string.IsNullOrEmpty(Configuration["Domain"])) options.Cookie.Domain = Configuration["Domain"];
|
||||||
});
|
});
|
||||||
services.AddApiVersioning(option =>
|
services.AddApiVersioning(option =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,7 +60,7 @@ namespace Bootstrap.Client
|
||||||
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options =>
|
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options =>
|
||||||
{
|
{
|
||||||
options.Cookie.Path = "/";
|
options.Cookie.Path = "/";
|
||||||
options.Cookie.Domain = Configuration["Domain"];
|
if (!string.IsNullOrEmpty(Configuration["Domain"])) options.Cookie.Domain = Configuration["Domain"];
|
||||||
options.RebuildRedirectUri(Configuration["AuthHost"]);
|
options.RebuildRedirectUri(Configuration["AuthHost"]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue