Skip to content

Commit da50e67

Browse files
authored
doc(DataProtection): add PersistKeysToFileSystem call (#7801)
1 parent 6ac961e commit da50e67

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/BootstrapBlazor.Server/Extensions/ServiceCollectionSharedExtensions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
55

66
using Microsoft.AspNetCore.Components.Authorization;
7+
using Microsoft.AspNetCore.DataProtection;
78

89
namespace Microsoft.Extensions.DependencyInjection;
910

@@ -98,7 +99,9 @@ public static IServiceCollection AddBootstrapBlazorServices(this IServiceCollect
9899
services.AddBootstrapBlazorRegionService();
99100

100101
// 增加密钥存储配置
101-
services.AddDataProtection();
102+
services.AddDataProtection()
103+
.SetApplicationName("BootstrapBlazor")
104+
.PersistKeysToFileSystem(new DirectoryInfo(Path.Combine(AppContext.BaseDirectory, "keys")));
102105

103106
// 增加 PetaPoco ORM 数据服务操作类
104107
// 需要时打开下面代码

0 commit comments

Comments
 (0)