Files
AzureStaticWebApp-CSharp-Si…/app/Pages/Secured.razor
T
2021-06-06 13:34:07 -04:00

20 lines
420 B
Plaintext

@page "/secured"
@using Microsoft.AspNetCore.Authorization
@inject HttpClient Http
@attribute [Authorize(Roles = "admin")]
<h1>Azure Function Test</h1>
<h2>@result</h2>
@code {
private string result = "temp value";
protected override async Task OnInitializedAsync()
{
var response = await Http.GetStringAsync("/api/secured/HelloYou?name=cloudies");
result = response.ToString();
}
}