oauth-io / sdk-php

OAuth that just works ! This is the PHP SDK for OAuth.io
https://oauth.io
86 stars 10 forks source link

Twitch authentication error #24

Open xlith opened 6 years ago

xlith commented 6 years ago

We are trying to write an authantication module for our Drupal 8 website. We are using oAuth.io for external authantications (with social media platforms) every other platform works perfectly. But when we try to login with Twitch we get the error:

Notice: Trying to get property of non-object in OAuth_io\RequestObject->me() (line 133 of [root]/vendor/oauth-io/oauth/src/OAuth_io/RequestObject.php)

This is the code in our redirect page:

$oauth = new OAuth();
        $oauth->initialize(['oauthApiKey'], ['oauthSecretKey']);
        $request_object = $oauth->auth($provider, [
          'redirect' => true
        ]);
 $socialDataArray = $request_object->me('email'); [or ->me() -both the same]

This is very urgent. Could you please help?