Skip to content

Commit 05dfb04

Browse files
authored
Merge pull request #35558 from dotnet/main
2 parents afaf210 + 2e1aab3 commit 05dfb04

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

aspnetcore/blazor/security/blazor-web-app-with-oidc.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,9 @@ The `Weather` component uses the [`[Authorize]` attribute](xref:Microsoft.AspNet
554554
The `ExternalApi` HTTP client is used to make a request for weather data to the secure web API. In the [`OnInitializedAsync` lifecycle event](xref:blazor/components/lifecycle#component-initialization-oninitializedasync) of `Weather.razor`:
555555

556556
```csharp
557-
using var request =
558-
new HttpRequestMessage(HttpMethod.Get, "/weather-forecast");
559-
using var client = ClientFactory.CreateClient("ExternalApi");
560-
557+
using var request = new HttpRequestMessage(HttpMethod.Get, "/weather-forecast");
558+
var client = ClientFactory.CreateClient("ExternalApi");
561559
using var response = await client.SendAsync(request);
562-
563560
response.EnsureSuccessStatusCode();
564561

565562
forecasts = await response.Content.ReadFromJsonAsync<WeatherForecast[]>() ??

aspnetcore/blazor/security/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,9 +812,7 @@ internal sealed class ServerWeatherForecaster(HttpClient httpClient,
812812
using var request =
813813
new HttpRequestMessage(HttpMethod.Get, "/weather-forecast");
814814
request.Headers.Authorization = new("Bearer", accessToken);
815-
816815
using var response = await httpClient.SendAsync(request);
817-
818816
response.EnsureSuccessStatusCode();
819817

820818
return await response.Content.ReadFromJsonAsync<WeatherForecast[]>() ??

0 commit comments

Comments
 (0)