File tree 2 files changed +4
-3
lines changed
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ private async Task RevalidationLoop()
64
64
{
65
65
// Force sign-out. Also stop the revalidation loop, because the user can
66
66
// only sign back in by starting a new connection.
67
- var anonymousUser = new ClaimsPrincipal ( ) ;
67
+ var anonymousUser = new ClaimsPrincipal ( new ClaimsIdentity ( ) ) ;
68
68
_currentAuthenticationStateTask = Task . FromResult ( new AuthenticationState ( anonymousUser ) ) ;
69
69
NotifyAuthenticationStateChanged ( _currentAuthenticationStateTask ) ;
70
70
_loopCancellationTokenSource . Cancel ( ) ;
Original file line number Diff line number Diff line change @@ -67,8 +67,6 @@ public void ConfigureServices(IServiceCollection services)
67
67
#endif
68
68
services . AddDefaultIdentity < IdentityUser > ( )
69
69
. AddEntityFrameworkStores < ApplicationDbContext > ( ) ;
70
-
71
- services . AddScoped < AuthenticationStateProvider , RevalidatingAuthenticationStateProvider < IdentityUser > > ( ) ;
72
70
#elif ( OrganizationalAuth )
73
71
services . AddAuthentication ( AzureADDefaults . AuthenticationScheme )
74
72
. AddAzureAD ( options => Configuration . Bind ( "AzureAd" , options ) ) ;
@@ -127,6 +125,9 @@ public void ConfigureServices(IServiceCollection services)
127
125
#endif
128
126
services . AddRazorPages ( ) ;
129
127
services . AddServerSideBlazor ( ) ;
128
+ #if ( IndividualLocalAuth )
129
+ services . AddScoped < AuthenticationStateProvider , RevalidatingAuthenticationStateProvider < IdentityUser > > ( ) ;
130
+ #endif
130
131
services . AddSingleton < WeatherForecastService > ( ) ;
131
132
}
132
133
You can’t perform that action at this time.
0 commit comments