@using BootStrapComponents @using Components @using Models.Identity @using Newtonsoft.Json @using BlazorPages.Tools @page "/" @layout LayoutWithoutMenu

Welcome to next generation of farming

Login Sign up
@code { public bool DataGotten { set; get; } protected override async void OnInitialized() { var hasToken = await LocalStorage.ContainKeyAsync(Statics.LoginTokenKey); if (hasToken) { var token = await LocalStorage.GetItemAsStringAsync(Statics.LoginTokenKey); var res = await _userUtils.CheckLogin(goToLogin: false); var result = JsonConvert.DeserializeObject( await res.Content.ReadAsStringAsync()); if (res.IsSuccessStatusCode) { await LoadingSpinner.HideLoading(); Statics.CurrentLoginInfo = result; NavManager.NavigateTo("/dashboard"); } } DataGotten = true; StateHasChanged(); } }