From b9db912441ba5e9c0d948f77721e1cea7df5993d Mon Sep 17 00:00:00 2001 From: MahanCh Date: Mon, 7 Jul 2025 14:00:21 +0330 Subject: [PATCH] Revert "set cookie domain" This reverts commit b3d339d7fb64a3b6a7aae01e938ecf73e5adcdae. --- ServiceHost/Program.cs | 12 +++--------- ServiceHost/appsettings.Development.json | 7 ++----- ServiceHost/appsettings.json | 5 +---- ServiceHost/web.config | 10 ++++------ 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/ServiceHost/Program.cs b/ServiceHost/Program.cs index 939f07b6..43a0cdfd 100644 --- a/ServiceHost/Program.cs +++ b/ServiceHost/Program.cs @@ -94,14 +94,14 @@ builder.Services.Configure(options => options.CheckConsentNeeded = context => true; //options.MinimumSameSitePolicy = SameSiteMode.Strict; }); -var cookieDomain = builder.Configuration["CookieSettings:Domain"]; + builder.Services.ConfigureApplicationCookie(options => { //options.Cookie.Name = "GozarAuth"; options.Cookie.HttpOnly = true; options.Cookie.SameSite = SameSiteMode.None; // مهم ✅ options.Cookie.SecurePolicy = CookieSecurePolicy.Always; // فقط روی HTTPS کار می‌کنه ✅ - options.Cookie.Domain = cookieDomain; // دامنه مشترک بین پدر و ساب‌دامین‌ها ✅ + options.Cookie.Domain = ".dad-mehr.ir"; // دامنه مشترک بین پدر و ساب‌دامین‌ها ✅ }); @@ -263,13 +263,7 @@ builder.Services.AddCors(options => "https://gozareshgir.ir", "https://dad-mehr.ir", "https://admin.dad-mehr.ir", - "https://admin.gozareshgir.ir", - "https://api.local.dad-mehr.ir", - "https://local.dad-mehr.ir", - "https://localhost:7080", - "https://api.local.dad-mehr.ir:7080" - //"http://localhost:3001", - + "https://admin.gozareshgir.ir" ) .AllowAnyHeader() .AllowAnyMethod() diff --git a/ServiceHost/appsettings.Development.json b/ServiceHost/appsettings.Development.json index 5a01248e..909ff3cd 100644 --- a/ServiceHost/appsettings.Development.json +++ b/ServiceHost/appsettings.Development.json @@ -13,7 +13,7 @@ //server //"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;", - + //local "MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;", @@ -31,10 +31,7 @@ "SmsSecrets": { "ApiKey": "Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa", "SecretKey": "dadmehr" - }, - "CookieSettings": { - "Domain": ".local.dad-mehr.ir" } - } + diff --git a/ServiceHost/appsettings.json b/ServiceHost/appsettings.json index 4e8374d5..b5c17e38 100644 --- a/ServiceHost/appsettings.json +++ b/ServiceHost/appsettings.json @@ -22,8 +22,5 @@ "faceModels": { "Faces": "c://labels//20//" }, - "AllowedHosts": "*", - "CookieSettings": { - "Domain": ".dad-mehr.ir" - } + "AllowedHosts": "*" } diff --git a/ServiceHost/web.config b/ServiceHost/web.config index d982bbfb..82d5b955 100644 --- a/ServiceHost/web.config +++ b/ServiceHost/web.config @@ -5,11 +5,8 @@ - - - - - + + @@ -18,4 +15,5 @@ - \ No newline at end of file + +