i am trying to make a simple login validation for a website im building using the twitch api,
but i ran into a problem which is very annoying and blocking the login from working.
The thing thats going on is like this:
i reffer them to the authenticate part of twitch(this is working fine and im getting an code back)
but when i try to get a token from the twitch server something goes wrong, the script is showing that its working fine and all but when i use a var_dump to show the contents of the returned json encoded data i get something like this:
Please note that i replaced the actual acces_token value and refresh_token value with ‘#’ for security reasons.
now the problem is that i cannot make a object from this json string, because its not a json string but a boolean, now im wondering how i can fix this so that i can work with this json string, if i copy the string and paste it in the json_decode function then it is parsing properly so im wondering whats going wrong.
i solved the problem by settings another setting in curl:
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
with this setting i tell curl to give back the actual information instead of just true or false.