Skip to content

Commit ee81a3b

Browse files
committed
Fix compile error in PersistingRevalidatingAuthenticationStateProvider
1 parent 7906488 commit ee81a3b

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/template.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@
113113
{
114114
"condition": "(!IndividualLocalAuth)",
115115
"exclude": [
116-
"BlazorWeb-CSharp/Components/Pages/Account/**",
117116
"BlazorWeb-CSharp/Components/Identity/**",
117+
"BlazorWeb-CSharp/Components/Layout/ManageLayout.razor",
118+
"BlazorWeb-CSharp/Components/Layout/ManageNavMenu.razor",
119+
"BlazorWeb-CSharp/Components/Pages/Account/**",
118120
"BlazorWeb-CSharp/Data/**",
119121
"BlazorWeb-CSharp/Identity/**",
120122
"BlazorWeb-CSharp.Client/PersistentAuthenticationStateProvider.cs",

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Identity/PersistingRevalidatingAuthenticationStateProvider.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,7 @@ public PersistingRevalidatingAuthenticationStateProvider(
3333
_options = options.Value;
3434

3535
AuthenticationStateChanged += OnAuthenticationStateChanged;
36-
#if (UseServer && UseWebAssembly)
37-
_subscription = state.RegisterOnPersisting(OnPersistingAsync, RenderMode.InteractiveAuto);
38-
}, RenderMode.InteractiveAuto);
39-
#else
40-
_subscription = state.RegisterOnPersisting(OnPersistingAsync, RenderMode.InteractiveServer);
41-
#endif
36+
_subscription = state.RegisterOnPersisting(OnPersistingAsync, RenderMode.InteractiveWebAssembly);
4237
}
4338

4439
protected override TimeSpan RevalidationInterval => TimeSpan.FromMinutes(30);

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Program.Main.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
using BlazorWeb_CSharp.Components;
1414
#if (IndividualLocalAuth)
1515
using BlazorWeb_CSharp.Data;
16+
#if (UseServer || UseWebAssembly)
1617
using BlazorWeb_CSharp.Identity;
1718
#endif
19+
#endif
1820

1921
namespace BlazorWeb_CSharp;
2022

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
using BlazorWeb_CSharp.Components;
1414
#if (IndividualLocalAuth)
1515
using BlazorWeb_CSharp.Data;
16+
#if (UseServer || UseWebAssembly)
1617
using BlazorWeb_CSharp.Identity;
1718
#endif
19+
#endif
1820

1921
var builder = WebApplication.CreateBuilder(args);
2022

0 commit comments

Comments
 (0)