protected HttpClient GetHttpClient() { HttpClient httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", propertiesService.GetJwtToken()); return(httpClient); }
private async Task <bool> IsTokenValid() { string token = propertiesService.GetJwtToken(); string userName = propertiesService.GetUserName(); string[] userProperties = { token, userName }; if (userProperties.Any(it => string.IsNullOrEmpty(it))) { return(false); } try { await applicationUsersService.GetApplicationUsersAsync(); } catch (UnauthorizedAccessException) { return(false); } return(true); }