TourIAm/TIAMSharedUI/Pages/Components/AuthComponent.razor.cs

33 lines
793 B
C#

using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TIAMWebApp.Shared.Application.Interfaces;
namespace TIAMSharedUI.Pages.Components
{
public partial class AuthComponent : ComponentBase
{
[Inject]
public ISessionService sessionService { get; set; }
public bool IsLoggedIn = false;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
IsLoggedIn = sessionService.IsAuthenticated;
StateHasChanged();
}
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender);
}
}
}