From 31af30b1eebf859b7448dbc7045854180317138b Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Thu, 30 Oct 2014 23:46:20 +0100 Subject: [PATCH] Seems to work, removing some debug code --- Site5/Security/BitId.aspx.cs | 3 ++- Site5/Security/Login.aspx | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Site5/Security/BitId.aspx.cs b/Site5/Security/BitId.aspx.cs index 23efea9b..925d4a1f 100644 --- a/Site5/Security/BitId.aspx.cs +++ b/Site5/Security/BitId.aspx.cs @@ -18,7 +18,7 @@ namespace Swarmops.Security protected void Page_Load(object sender, EventArgs e) { string nonce = Request.Params["Nonce"]; - string identity = GuidCache.Get(nonce + "-Identity") as string; + string identity = (string) GuidCache.Get(nonce + "-Identity"); if (string.IsNullOrEmpty(identity)) { @@ -27,6 +27,7 @@ namespace Swarmops.Security else { GuidCache.Delete(nonce + "-Identity"); + Persistence.Key["BitId_AuthComplete"] = DateTime.Now.ToString(); FormsAuthentication.RedirectFromLoginPage(identity, true); } } diff --git a/Site5/Security/Login.aspx b/Site5/Security/Login.aspx index 8e88d65f..947a7f2b 100644 --- a/Site5/Security/Login.aspx +++ b/Site5/Security/Login.aspx @@ -43,7 +43,6 @@ }); // end of document.ready function recheckLogin() { - alertify.log("Checking"); $.ajax({ type: "POST", url: "Login.aspx/TestLogin", @@ -51,18 +50,16 @@ contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { - alertify.success("Success " + msg.d); if (msg.d) { - alert("Successful login! Redirecting..."); - document.location = "/"; + alert("For great justice!!"); + document.location = "/BitId.aspx?Nonce=" + bitIdNonce; } else { setTimeout(function () { recheckLogin(); - }, 1000); + }, 500); } }, error: function (msg) { - alertify.error("Error " + msg.d); // we don't want the polling to die just because of a transient error setTimeout(function () { recheckLogin();