fix for antiforgery exceptions

This commit is contained in:
Hamid Reza Mohammadi 2025-01-27 09:56:32 +03:30
parent d483f7bd6a
commit 68e652db4a
3 changed files with 7 additions and 1 deletions

View File

@ -1,7 +1,9 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System.IO;
using System.Text.Encodings.Web;
using System.Text.Unicode;
@ -43,6 +45,9 @@ namespace GanjooRazor
});
});
services.AddDataProtection()
.PersistKeysToFileSystem(new DirectoryInfo(Configuration["DataProtectionPersistPath"]))
.SetApplicationName("GanjooRazor");
}

View File

@ -20,5 +20,6 @@
"AggressiveCacheEnabled": "False",
"BannersEnabled": "False",
"ReadOnlyMode": "False",
"DataProtectionPersistPath": "C:\\Keys",
"MaintenanceMode": "False"
}

View File

@ -2595,7 +2595,7 @@
returns image stream with image/jpeg MIME type
</summary>
<param name="id"></param>
<param name="size"></param>
<param name="size">norm/orig/thumb</param>
<param name="mimeForResized"></param>
<returns></returns>
</member>