Trying a long shot to fix bitid 2
This commit is contained in:
@@ -525,7 +525,7 @@ namespace Swarmops.Frontend
|
||||
bitIdUri += "&u=1";
|
||||
}
|
||||
|
||||
GuidCache.Set(bitIdUri + "-Intent", "Register"); // Intent: register BitID
|
||||
GuidCache.Set(bitIdUri + "-Intent", "Register-" + CurrentUser.Identity.ToString(CultureInfo.InvariantCulture)); // Intent: register BitID
|
||||
|
||||
return bitIdUri;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,6 @@ namespace Swarmops.Pages.Security
|
||||
|
||||
protected static void ProcessRespondBitId (BitIdCredentials credentials, HttpResponse response)
|
||||
{
|
||||
AuthenticationData authData = GetAuthenticationDataAndCulture();
|
||||
|
||||
BitcoinPubKeyAddress testAddress = new BitcoinPubKeyAddress (credentials.address);
|
||||
if (testAddress.VerifyMessage (credentials.uri, credentials.signature))
|
||||
@@ -212,19 +211,23 @@ namespace Swarmops.Pages.Security
|
||||
|
||||
try
|
||||
{
|
||||
if (authData.CurrentUser != null)
|
||||
// Test for registration
|
||||
|
||||
string intent = GuidCache.Get(credentials.uri + "-Intent") as string;
|
||||
|
||||
if (!string.IsNullOrEmpty(intent))
|
||||
{
|
||||
if ((string) GuidCache.Get (credentials.uri + "-Intent") == "Register")
|
||||
if (intent.StartsWith("Register"))
|
||||
{
|
||||
// the currently logged-on user desires to register this address
|
||||
// so set currentUser bitid
|
||||
authData.CurrentUser.BitIdAddress = credentials.address;
|
||||
// Then go do something else, I guess? Flag somehow to original page
|
||||
// that the op is completed?
|
||||
GuidCache.Set (credentials.uri + "-Intent", "Complete");
|
||||
int personId = Int32.Parse(intent.Substring("Register-".Length));
|
||||
Person person = Person.FromIdentity(personId);
|
||||
person.BitIdAddress = credentials.address;
|
||||
GuidCache.Set(credentials.uri + "-Intent", "Complete");
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise, test for logon
|
||||
|
||||
if (GuidCache.Get (credentials.uri + "-Logon") as string == "Unauth")
|
||||
{
|
||||
Person person = Person.FromBitIdAddress (credentials.address);
|
||||
|
||||
Reference in New Issue
Block a user