File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp Expand file tree Collapse file tree 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()
6464 {
6565 // Force sign-out. Also stop the revalidation loop, because the user can
6666 // only sign back in by starting a new connection.
67- var anonymousUser = new ClaimsPrincipal ( ) ;
67+ var anonymousUser = new ClaimsPrincipal ( new ClaimsIdentity ( ) ) ;
6868 _currentAuthenticationStateTask = Task . FromResult ( new AuthenticationState ( anonymousUser ) ) ;
6969 NotifyAuthenticationStateChanged ( _currentAuthenticationStateTask ) ;
7070 _loopCancellationTokenSource . Cancel ( ) ;
Original file line number Diff line number Diff line change @@ -67,8 +67,6 @@ public void ConfigureServices(IServiceCollection services)
6767#endif
6868 services . AddDefaultIdentity < IdentityUser > ( )
6969 . AddEntityFrameworkStores < ApplicationDbContext > ( ) ;
70-
71- services . AddScoped < AuthenticationStateProvider , RevalidatingAuthenticationStateProvider < IdentityUser > > ( ) ;
7270#elif ( OrganizationalAuth )
7371 services . AddAuthentication ( AzureADDefaults . AuthenticationScheme )
7472 . AddAzureAD ( options => Configuration . Bind ( "AzureAd" , options ) ) ;
@@ -127,6 +125,9 @@ public void ConfigureServices(IServiceCollection services)
127125#endif
128126 services . AddRazorPages ( ) ;
129127 services . AddServerSideBlazor ( ) ;
128+ #if ( IndividualLocalAuth )
129+ services . AddScoped < AuthenticationStateProvider , RevalidatingAuthenticationStateProvider < IdentityUser > > ( ) ;
130+ #endif
130131 services . AddSingleton < WeatherForecastService > ( ) ;
131132 }
132133
You can’t perform that action at this time.
0 commit comments