mirror of
https://github.com/farcasclaudiu/AzureStaticWebApp-CSharp-SimpleDemo.git
synced 2026-06-22 07:01:03 +03:00
20 lines
420 B
Plaintext
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();
|
|
}
|
|
|
|
} |