The way Twitter Sign in handles the Twitter response is incomplete. In my own implementation, I've had a couple of times that Twitter sent back an empty response - or at least a response that doesn't contain any user data.
The current code doesn't handle this possibility. In my implementation I put the code within a try/catch statement to catch this:
try {
$account = user_save('', $edit);
} catch (Exception $e) {
watchdog('oauth_login', "Exception saving new account: ".$e->getMessage(),'',WATCHDOG_WARNING);
return false;
}
Comments
Comment #1
steinmb commentedYeah it is important that we catch this before passing them on. Twitter.com might be overloaded, network problems etc. Rerolling without doing a lot of testing just to get this issue rolling again. It is hard to belive that it's been not a single comment since it was posted back in 2009.
Comment #2
13rac1 commentedApplies with fuzz to 6.x-5.x. Should ported to 7.x?
Comment #3
13rac1 commentedComment #4
xurizaemonDuplicated by #1047262: Twitter does not hanlde app access deny case (patch there also). Should be re-rolled for 7.x-5.x.
Comment #5
xurizaemonComment #6
steinmb commentedDid this patch make it into 6.x?
Comment #7
xurizaemonDoesn't look like it (http://drupalcode.org/project/twitter.git/blob/refs/heads/6.x-5.x:/twitt...) and I hope it would but ideally now coming in via 7.x-5.x first.
https://api.drupal.org/api/drupal/modules%21user%21user.module/function/...
does user_save really throw an exception in d6?
I don't think it does, so that patch feels like it might be improved to identify the cause of the exception here. Oh right, it will be from the SQL insert?
Comment #8
xurizaemon(Sorry, on mobile. Am trying to wrestle this queue into shape - if this patch is good enough to go in, help me better understand the details please.)
Comment #9
damienmckennaComment #10
damienmckennaComment #12
damienmckennaDoes this problem still happen in the 7.x-5.x or 7.x-6.x branches?
Comment #13
damienmckennaYes, this could still be a problem with the current version.
Comment #14
damienmckennaComment #15
damienmckennaPorted to 7.x-6.x.
Comment #16
damienmckennaPorted to 6.x-5.x.
Comment #17
damienmckennaCommitted. Thanks!