fuel / auth

Fuel PHP Framework - Fuel v1.x Authentication package
http://fuelphp.com/docs/packages/auth/intro.html
76 stars 57 forks source link

Integer bug in login_or_register #89

Closed andymoreno closed 10 years ago

andymoreno commented 10 years ago

I've got a pretty much default install of FuelPHP 1.7.2 with OrmAuth and it kept failing to authenticate. My configuration was to only use Facebook so I turned off multiple providers.

I found the solution to my issue in Auth_Opauth->login_or_register(), line 210, just declaring the result as integer: from: $num_linked = ($result and $result = $result->current()) ? $result['count'] : 0; to: $num_linked = ($result and $result = $result->current()) ? (int) $result['count'] : 0;

Line 213 is checking if the result is exactly 0, but the result comes back as a string so kept failing. If you use multiple providers you would never see this issue.

Thank you for a great product, /Andy

WanWizard commented 10 years ago

Very good find, thanks! All our apps use multiple providers, so I hadn't encountered this issue.