Skip to content

Commit

Permalink
Clean up compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdecock committed Apr 30, 2024
1 parent 8f04baf commit 5b91b76
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class CircuitServicesAccessor
internal IServiceProvider? Services
{
get => blazorServices.Value;
set => blazorServices.Value = value;
set => blazorServices.Value = value!;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,18 @@ public static IServiceCollection AddOpenIdConnectAccessTokenManagement(this ISer
return services;
}

public static IServiceCollection AddBlazorServerAccessTokenManagement<T>(this IServiceCollection services)
where T : class, IUserTokenStore
/// <summary>
/// Adds implementations of services that enable access token management in
/// Blazor Server.
/// </summary>
/// <typeparam name="TTokenStore">An IUserTokenStore implementation. Blazor
/// Server requires an IUserTokenStore because the default token store
/// relies on cookies, which are not present when streaming updates over a
/// blazor circuit. </typeparam>
public static IServiceCollection AddBlazorServerAccessTokenManagement<TTokenStore>(this IServiceCollection services)
where TTokenStore : class, IUserTokenStore
{
services.AddSingleton<IUserTokenStore, T>();
services.AddSingleton<IUserTokenStore, TTokenStore>();
services.AddScoped<IUserAccessor, BlazorServerUserAccessor>();
services.AddCircuitServicesAccessor();
services.AddHttpContextAccessor(); // For SSR
Expand Down

0 comments on commit 5b91b76

Please sign in to comment.