diff --git a/src/Form/SlackInviteSettingsForm.php b/src/Form/SlackInviteSettingsForm.php index 9f1f2f1..8b3b0e9 100644 --- a/src/Form/SlackInviteSettingsForm.php +++ b/src/Form/SlackInviteSettingsForm.php @@ -87,8 +87,8 @@ class SlackInviteSettingsForm extends ConfigFormBase { throw new Exception('Failed request'); } // Ensure the correct scope is set. - if (isset($response->headers['x-oauth-scopes'][0])) { - $scopes = explode(',', $response->headers['x-oauth-scopes'][0]); + if ($response->hasHeader('x-oauth-scopes')) { + $scopes = explode(',', $response->getHeader('x-oauth-scopes')[0]); if (!in_array('admin', $scopes)) { $form_state->setErrorByName('slack_invite_token', $this->t('The supplied token is missing the required scope: admin')); }