n8n-nodes-jygse-vw-weconnect 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -176,7 +176,17 @@ async function vwLogin(context, email, password) {
176
176
  }
177
177
  else if (authorizeResponse && typeof authorizeResponse === 'object') {
178
178
  const respObj = authorizeResponse;
179
- htmlContent = respObj.body || JSON.stringify(respObj);
179
+ // Try different possible response structures
180
+ if (respObj.body && typeof respObj.body === 'string') {
181
+ htmlContent = respObj.body;
182
+ }
183
+ else if (respObj.data && typeof respObj.data === 'string') {
184
+ htmlContent = respObj.data;
185
+ }
186
+ else {
187
+ // Serialize the object to see its structure in the error
188
+ htmlContent = JSON.stringify(respObj);
189
+ }
180
190
  }
181
191
  else {
182
192
  htmlContent = String(authorizeResponse);
@@ -185,7 +195,9 @@ async function vwLogin(context, email, password) {
185
195
  const relayStateMatch = htmlContent.match(/name="relayState"\s+value="([^"]+)"/);
186
196
  const hmacMatch = htmlContent.match(/name="hmac"\s+value="([^"]+)"/);
187
197
  if (!csrfMatch) {
188
- throw new Error(`Could not extract CSRF token from login page. Response type: ${typeof authorizeResponse}`);
198
+ // Show first 500 chars of response for debugging
199
+ const preview = htmlContent.substring(0, 500);
200
+ throw new Error(`Could not extract CSRF token. Response preview: ${preview}`);
189
201
  }
190
202
  const csrf = csrfMatch[1];
191
203
  const relayState = relayStateMatch ? relayStateMatch[1] : '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-jygse-vw-weconnect",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "n8n community node for VW We Connect - Control your Volkswagen T6.1 and other VW vehicles",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",