This repository has been archived on 2025-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
2019-09-15 18:36:39 -04:00

35 lines
838 B
Plaintext

@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Web
@using Oqtane.Themes
@namespace Oqtane.Themes.Controls
@inherits ThemeObjectBase
@inject NavigationManager NavigationManager
<AuthorizeView>
<Authorizing>
<text>...</text>
</Authorizing>
<Authorized>
<button type="button" class="btn btn-primary" @onclick="UpdateProfile">@context.User.Identity.Name</button>
</Authorized>
<NotAuthorized>
<button type="button" class="btn btn-primary" @onclick="RegisterUser">Register</button>
</NotAuthorized>
</AuthorizeView>
@code {
private void RegisterUser()
{
NavigationManager.NavigateTo(NavigateUrl("register"));
}
private void UpdateProfile()
{
NavigationManager.NavigateTo(NavigateUrl("profile"));
}
}