Wha.. ? What happened...
I tried to grok the 200 lines of code that signifies an actionresult which somehow starts at stage 2 and contains the word if 54 times. After having read it 3 times I uh,
Everyone deals with success in their own way.
What makes it kind of complicated though is the basic process of authenticating efficiently against multiple providers all the while accounting for a slough of strange behaviors and attempted exploitations (turns out that programmers like to game systems).
Perhaps the user wanted to use an openid provider, but didn't have an account with them. Well it is too late. They were already redirected. So at that point the user is making a new account and then expects to magically return all signed in using their newly created account.
But hey, that doesn't always happen. Maybe they entered the correct credentials for the provider and the rest of the exchange side for the user needs to be examined. Is this openid even associated with someone? Or, does someone already have a different openid associated with them but logged in with this one for some reason while already logged in with another one?
If they did have the correct openid account, and no account with SE, maybe they want to create one? Or they don't have to. What if they try to create one but it exists? Better hold on to that openid authentication through this whole process. Definitely don't want to start over... that would be awkward! That is strange, this user was merged with another user but tried to log in from their original openid.
Dang. Did all that and they weren't even using https. They should probably start over. Finally, got through it all again? Then you went afk for two days and clicked submit? Did your cookie expire? Hm. Oh well, lets send the user back.. Wait, where were they again?