Merge pull request #447 from openziti/mfa-issues

Remove Recovery Code On Enroll, and fix timeout on tick down
This commit is contained in:
Mary Dcouto
2021-09-21 22:05:44 +05:30
committed by GitHub
3 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -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", "");
}
@@ -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--;
}
+9 -2
View File
@@ -221,6 +221,15 @@ namespace ZitiDesktopEdge {
}
}
/// <summary>
/// Call the MFA Functions
///
/// Types:
/// 1 = Normal MFA Authentication
/// 2 = Get Recovery Codes
/// 3 = Remove MFA
/// 4 = Generate New MFA Codes
/// </summary>
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;