@@ -10,7 +10,7 @@ namespace Duende.Bff.Blazor.Client;
10
10
11
11
public static class ServiceCollectionExtensions
12
12
{
13
- public static IServiceCollection AddBff ( this IServiceCollection services ,
13
+ public static IServiceCollection AddBffBlazorClient ( this IServiceCollection services ,
14
14
Action < BffBlazorOptions > ? configureAction = null )
15
15
{
16
16
if ( configureAction != null )
@@ -21,7 +21,6 @@ public static IServiceCollection AddBff(this IServiceCollection services,
21
21
services
22
22
. AddAuthorizationCore ( )
23
23
. AddScoped < AuthenticationStateProvider , BffClientAuthenticationStateProvider > ( )
24
- . AddCascadingAuthenticationState ( )
25
24
. AddTransient < AntiforgeryHandler > ( )
26
25
. AddHttpClient ( "BffAuthenticationStateProvider" , ( sp , client ) =>
27
26
{
@@ -52,7 +51,7 @@ private static string GetRemoteApiPath(IServiceProvider sp)
52
51
return opt . Value . RemoteApiPath ;
53
52
}
54
53
55
- private static Action < IServiceProvider , HttpClient > SetBaseAddressInConfigureClient (
54
+ private static Action < IServiceProvider , HttpClient > SetBaseAddress (
56
55
Action < IServiceProvider , HttpClient > ? configureClient )
57
56
{
58
57
return ( sp , client ) =>
@@ -62,7 +61,7 @@ private static Action<IServiceProvider, HttpClient> SetBaseAddressInConfigureCli
62
61
} ;
63
62
}
64
63
65
- private static Action < IServiceProvider , HttpClient > SetBaseAddressInConfigureClient (
64
+ private static Action < IServiceProvider , HttpClient > SetBaseAddress (
66
65
Action < HttpClient > ? configureClient )
67
66
{
68
67
return ( sp , client ) =>
@@ -100,30 +99,30 @@ private static void SetBaseAddress(IServiceProvider sp, HttpClient client)
100
99
public static IHttpClientBuilder AddRemoteApiHttpClient ( this IServiceCollection services , string clientName ,
101
100
Action < HttpClient > configureClient )
102
101
{
103
- return services . AddHttpClient ( clientName , SetBaseAddressInConfigureClient ( configureClient ) )
102
+ return services . AddHttpClient ( clientName , SetBaseAddress ( configureClient ) )
104
103
. AddHttpMessageHandler < AntiforgeryHandler > ( ) ;
105
104
}
106
105
107
106
public static IHttpClientBuilder AddRemoteApiHttpClient ( this IServiceCollection services , string clientName ,
108
107
Action < IServiceProvider , HttpClient > ? configureClient = null )
109
108
{
110
- return services . AddHttpClient ( clientName , SetBaseAddressInConfigureClient ( configureClient ) )
109
+ return services . AddHttpClient ( clientName , SetBaseAddress ( configureClient ) )
111
110
. AddHttpMessageHandler < AntiforgeryHandler > ( ) ;
112
111
}
113
112
114
113
public static IHttpClientBuilder AddRemoteApiHttpClient < T > ( this IServiceCollection services ,
115
114
Action < HttpClient > configureClient )
116
115
where T : class
117
116
{
118
- return services . AddHttpClient < T > ( SetBaseAddressInConfigureClient ( configureClient ) )
117
+ return services . AddHttpClient < T > ( SetBaseAddress ( configureClient ) )
119
118
. AddHttpMessageHandler < AntiforgeryHandler > ( ) ;
120
119
}
121
120
122
121
public static IHttpClientBuilder AddRemoteApiHttpClient < T > ( this IServiceCollection services ,
123
122
Action < IServiceProvider , HttpClient > ? configureClient = null )
124
123
where T : class
125
124
{
126
- return services . AddHttpClient < T > ( SetBaseAddressInConfigureClient ( configureClient ) )
125
+ return services . AddHttpClient < T > ( SetBaseAddress ( configureClient ) )
127
126
. AddHttpMessageHandler < AntiforgeryHandler > ( ) ;
128
127
}
129
128
}
0 commit comments