n8n-nodes-jygse-vw-weconnect 0.1.13 → 0.1.14
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.
|
@@ -228,12 +228,14 @@ async function vwLogin(context, email, password) {
|
|
|
228
228
|
let htmlContent;
|
|
229
229
|
let currentUrl = '';
|
|
230
230
|
let stateToken = '';
|
|
231
|
+
let httpStatusCode = 0;
|
|
231
232
|
if (typeof authorizeResponse === 'string') {
|
|
232
233
|
htmlContent = authorizeResponse;
|
|
233
234
|
}
|
|
234
235
|
else if (authorizeResponse && typeof authorizeResponse === 'object') {
|
|
235
236
|
const respObj = authorizeResponse;
|
|
236
237
|
const respHeaders = respObj.headers;
|
|
238
|
+
httpStatusCode = respObj.statusCode || 0;
|
|
237
239
|
// Check for redirect in headers (case-insensitive)
|
|
238
240
|
if (respHeaders) {
|
|
239
241
|
const locationHeader = respHeaders.location || respHeaders.Location;
|
|
@@ -254,6 +256,11 @@ async function vwLogin(context, email, password) {
|
|
|
254
256
|
else {
|
|
255
257
|
htmlContent = String(authorizeResponse);
|
|
256
258
|
}
|
|
259
|
+
// Debug: If we got an error page (status 400/500 or "Oops" in content), throw with details
|
|
260
|
+
if (httpStatusCode >= 400 || htmlContent.includes('Oops!, something went wrong')) {
|
|
261
|
+
const preview = htmlContent.substring(0, 1000);
|
|
262
|
+
throw new Error(`CARIAD BFF Error (HTTP ${httpStatusCode}): ${preview}`);
|
|
263
|
+
}
|
|
257
264
|
// Follow redirects manually to capture the state parameter
|
|
258
265
|
let maxInitialRedirects = 5;
|
|
259
266
|
while (currentUrl && maxInitialRedirects > 0) {
|
package/package.json
CHANGED