n8n-nodes-jygse-vw-weconnect 0.1.14 → 0.1.15

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.
@@ -179,22 +179,7 @@ async function vwLogin(context, email, password) {
179
179
  try {
180
180
  const traceId = generateTraceId();
181
181
  const nonce = generateNonce();
182
- // Browser-like headers for initial authorization request
183
- // The CARIAD BFF expects a browser-style request, not an API-style request
184
- const browserHeaders = {
185
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
186
- 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
187
- 'Accept-Language': 'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7',
188
- 'Accept-Encoding': 'gzip, deflate, br',
189
- 'Connection': 'keep-alive',
190
- 'Upgrade-Insecure-Requests': '1',
191
- 'Sec-Fetch-Dest': 'document',
192
- 'Sec-Fetch-Mode': 'navigate',
193
- 'Sec-Fetch-Site': 'none',
194
- 'Sec-Fetch-User': '?1',
195
- 'Cache-Control': 'max-age=0',
196
- };
197
- // API headers for subsequent requests (WeConnect-python style)
182
+ // API headers matching WeConnect-python v0.60.11 exactly
198
183
  const apiHeaders = {
199
184
  'User-Agent': VW_USER_AGENT,
200
185
  'Accept': '*/*',
@@ -214,11 +199,11 @@ async function vwLogin(context, email, password) {
214
199
  redirect_uri: VW_REDIRECT_URI,
215
200
  nonce: nonce,
216
201
  });
217
- // Use browser-like headers for the initial CARIAD BFF request
202
+ // Use WeConnect-python API headers for the initial CARIAD BFF request
218
203
  const authorizeResponse = await context.helpers.httpRequest({
219
204
  method: 'GET',
220
205
  url: `${authorizeUrl}?${authorizeParams.toString()}`,
221
- headers: browserHeaders,
206
+ headers: apiHeaders,
222
207
  encoding: 'text',
223
208
  returnFullResponse: true,
224
209
  ignoreHttpStatusErrors: true,
@@ -273,12 +258,12 @@ async function vwLogin(context, email, password) {
273
258
  if (currentUrl.includes('/u/login') && stateToken) {
274
259
  break;
275
260
  }
276
- // Follow the redirect using browser-like headers
261
+ // Follow the redirect using API headers
277
262
  const followUrl = currentUrl.startsWith('http') ? currentUrl : `https://identity.vwgroup.io${currentUrl}`;
278
263
  const followResponse = await context.helpers.httpRequest({
279
264
  method: 'GET',
280
265
  url: followUrl,
281
- headers: browserHeaders,
266
+ headers: apiHeaders,
282
267
  encoding: 'text',
283
268
  returnFullResponse: true,
284
269
  ignoreHttpStatusErrors: true,
@@ -481,9 +466,9 @@ async function vwLogin(context, email, password) {
481
466
  method: 'POST',
482
467
  url: `https://identity.vwgroup.io/u/login?state=${encodeURIComponent(stateToken)}`,
483
468
  headers: {
484
- 'User-Agent': browserHeaders['User-Agent'],
485
- 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
486
- 'Accept-Language': 'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7',
469
+ 'User-Agent': VW_USER_AGENT,
470
+ 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
471
+ 'Accept-Language': VW_ACCEPT_LANGUAGE,
487
472
  'Content-Type': 'application/x-www-form-urlencoded',
488
473
  'Origin': 'https://identity.vwgroup.io',
489
474
  'Referer': `https://identity.vwgroup.io/u/login?state=${encodeURIComponent(stateToken)}`,
@@ -561,7 +546,7 @@ async function vwLogin(context, email, password) {
561
546
  const followResponse = await context.helpers.httpRequest({
562
547
  method: 'GET',
563
548
  url: redirectUrl.startsWith('http') ? redirectUrl : `https://identity.vwgroup.io${redirectUrl}`,
564
- headers: browserHeaders,
549
+ headers: apiHeaders,
565
550
  encoding: 'text',
566
551
  returnFullResponse: true,
567
552
  ignoreHttpStatusErrors: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-jygse-vw-weconnect",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
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",