diff --git a/smtp_connector.py b/smtp_connector.py index 4bc3af5..6d1d60e 100644 --- a/smtp_connector.py +++ b/smtp_connector.py @@ -463,8 +463,10 @@ def _interactive_auth_refresh(self): except Exception: return phantom.APP_ERROR, "Error retrieving OAuth Token" + self._access_token = oauth_token.get('access_token') - self._refresh_token = oauth_token.get('refresh_token') + if response_json.get("refresh_token"): + self._refresh_token = oauth_token.get('refresh_token') self._state['oauth_token'] = oauth_token return phantom.APP_SUCCESS, ""