mirror of
https://github.com/Ylianst/MeshCentralRouter
synced 2026-01-16 15:03:14 +00:00
2FA cookie improvements.
This commit is contained in:
@@ -1076,6 +1076,7 @@ namespace MeshCentralRouter
|
||||
cookieRefreshTimer.Enabled = true;
|
||||
|
||||
// If we need to remember the 2nd factor, ask for a cookie now.
|
||||
if (debug) { try { File.AppendAllText("debug.log", "Requesting 2FA cookie\r\n"); } catch (Exception) { } }
|
||||
if (tokenRememberCheckBox.Checked) { meshcentral.sendCommand("{\"action\":\"twoFactorCookie\"}"); }
|
||||
|
||||
// Setup single instance pipe server
|
||||
|
||||
@@ -676,8 +676,11 @@ namespace MeshCentralRouter
|
||||
{
|
||||
if (jsonAction.ContainsKey("cookie"))
|
||||
{
|
||||
string cookie = (string)jsonAction["cookie"];
|
||||
if (onTwoFactorCookie != null) { onTwoFactorCookie(cookie); }
|
||||
if (jsonAction["cookie"] == null) return;
|
||||
if (jsonAction["cookie"].GetType() != typeof(string)) return;
|
||||
string cookie = null;
|
||||
try { cookie = (string)jsonAction["cookie"]; } catch (Exception) { }
|
||||
if ((cookie != null) && (onTwoFactorCookie != null)) { onTwoFactorCookie(cookie); }
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user