diff --git a/DesktopEdge/MainWindow.xaml.cs b/DesktopEdge/MainWindow.xaml.cs index 37b05c32..4aac7e8b 100644 --- a/DesktopEdge/MainWindow.xaml.cs +++ b/DesktopEdge/MainWindow.xaml.cs @@ -145,8 +145,8 @@ namespace ZitiDesktopEdge { break; } } - ShowMFARecoveryCodes(found); if (this.IdentityMenu.Identity != null && this.IdentityMenu.Identity.Fingerprint == mfa.Fingerprint) this.IdentityMenu.Identity = found; + ShowMFARecoveryCodes(found); } else { await ShowBlurbAsync("Provided code could not be verified", ""); } diff --git a/DesktopEdge/Views/ItemRenderers/IdentityItem.xaml.cs b/DesktopEdge/Views/ItemRenderers/IdentityItem.xaml.cs index c8b24210..e2482dc1 100644 --- a/DesktopEdge/Views/ItemRenderers/IdentityItem.xaml.cs +++ b/DesktopEdge/Views/ItemRenderers/IdentityItem.xaml.cs @@ -67,11 +67,12 @@ namespace ZitiDesktopEdge { if (info.Timeout>-1) { TimeSpan t = (DateTime.Now - info.TimeUpdated); int timePast = (int)Math.Floor(t.TotalSeconds); + int timeout = info.Timeout - timePast; + logger.Trace("Max: Service " + info.Name + " Updated " + timePast + " seconds ago will timeout in " + timeout + " seconds"); if (timePast > info.Timeout) { available--; + if (info.Timeout > -1) maxto = 0; } else { - int timeout = info.Timeout - timePast; - logger.Trace("Max: Service " + info.Name + " Updated " + timePast + " seconds ago will timeout in " + timeout + " seconds"); if (timeout > -1 && timeout > maxto) maxto = timeout; if (timeout == 0) available--; } diff --git a/DesktopEdge/Views/Screens/MFAScreen.xaml.cs b/DesktopEdge/Views/Screens/MFAScreen.xaml.cs index f752a6d1..83845b84 100644 --- a/DesktopEdge/Views/Screens/MFAScreen.xaml.cs +++ b/DesktopEdge/Views/Screens/MFAScreen.xaml.cs @@ -221,6 +221,15 @@ namespace ZitiDesktopEdge { } } + /// + /// Call the MFA Functions + /// + /// Types: + /// 1 = Normal MFA Authentication + /// 2 = Get Recovery Codes + /// 3 = Remove MFA + /// 4 = Generate New MFA Codes + /// async private void DoAuthenticate() { if (!this._executing) { @@ -236,8 +245,6 @@ namespace ZitiDesktopEdge { this.OnError?.Invoke("Authentication Failed"); this._executing = false; } else { - MfaRecoveryCodesResponse codeResponse = await serviceClient.ReturnMFACodes(this._identity.Fingerprint, code); - this._identity.MFAInfo.RecoveryCodes = codeResponse.Payload; this._identity.MFAInfo.IsAuthenticated = true; this.OnClose?.Invoke(true); this._executing = false;