Refreshing the token not working sometimes

Since last week, Sep 16, 2021, we are experiencing some issues with refreshing the tokens.

The request made to the refresh endpoint is hanging and unresponsive for a very long time and never timed out, even though we set a time out value of 30 seconds.

It's happening randomly for different accounts at different time.

$postFields = [
    'client_id' => 'CLIENT_ID',
    'client_secret' => 'CLIENT_SECRET',
    'refresh_token' => 'THE REFRESH TOKEN HERE',
    'grant_type' => 'refresh_token',
];

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => 'https://cloud.lightspeedapp.com/oauth/access_token.php',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_MAXREDIRS => 5,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => $postFields,
]);

// It's hanging here forever
$response = curl_exec($curl);
// it will never get until here
$error = curl_error($curl);
curl_close($curl);


Sign In or Register to comment.