public static void SyncData() { LocalLogger.Log($"Method {nameof(SyncData)} is running"); HubService.LogOnPage("Syncing data started.."); try { _jsonWebToken = Credentials.GetJsonWebToken(); if (string.IsNullOrWhiteSpace(_jsonWebToken)) { LocalLogger.Log($"[{nameof(SyncData)}] no web api authentication"); } SyncComputer(); SyncDisks(); SyncUsers(); SyncIntervalTimeLogs(); SyncBlockedApps(); SyncBlockedSites(); SyncTimeLimits(); } catch (Exception e) { LocalLogger.Log($"{nameof(SyncManager)} > {nameof(Credentials.GetJsonWebToken)}", e); } LocalLogger.Log($"Method {nameof(SyncData)} completed"); HubService.LogOnPage("Syncing done!"); }
public async void SignIn() { Busy = true; LocalLogger.Log("Signing in..."); var t = await Task.Run(() => _credentials.RenewBearerToken(_email, _password)); _succeded = !string.IsNullOrWhiteSpace(t?.AccessToken); AuthorizationStatus = _succeded ? "Success" : "Wrong email or password"; if (_succeded) { _credentials.StoreCredentials(_email, _password); _credentials.GetJsonWebToken(); TransferToEditorWindow(); } Busy = false; }