Refress Token Return NULL

The vardump returns a bool(true) but I don’t understand why?

$link = "https://id.twitch.tv/oauth2/token?grant_type=refresh_token&refresh_token=".$_SESSION['refresh_token']."&client_id=".$this->_client_id."&client_secret=".$this->_client_secret;

            $ch = curl_init($link);

            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");

            $res = curl_exec($ch);

            curl_close($ch);

    

            // Decode

            $token = json_decode($res);

            var_dump($token);

You didn’t set CURLOPT_RETURNTRANSFER as a curl_setopt

So $res as basic true/false on did curl die or not

This PHP example may help https://github.com/BarryCarlyon/twitch_misc/blob/main/authentication/user_access_generator/php/maintain_user_token.php#L21

1 Like

That work, thank you very much

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.