public async Task LoadAsync() { await Browser.LogToConsoleAsync("Reloading identity..."); var token = await Cookies.GetValueAsync(Constants.AUTH_TOKEN_COOKIE); if (token == null) { Identity = new Identity(); } else { var request = new GetUserInfoRequest(token); var response = await UserService.GetUserInfoAsync(request); Identity = new Identity(true, response); } await UserChangeNotifier.FireIdentityChangedAsync(); }
async Task UserChangeNotifier_AuthStateChangedAsync() { var token = await Cookies.GetValueAsync(Constants.AUTH_TOKEN_COOKIE); await WebMessageHubConnectionProvider.BindUserAsync(token); }