@auth0/auth0-checkmate 1.6.14 → 1.6.16
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.
|
@@ -77,6 +77,11 @@ function checkURLsForApp(app) {
|
|
|
77
77
|
return report;
|
|
78
78
|
}
|
|
79
79
|
allowed_logout_urls.forEach((url) => {
|
|
80
|
+
if (!url) {
|
|
81
|
+
// Skip null/undefined/empty URLs and log warning
|
|
82
|
+
console.warn(`[WARNING] App "${app.name}" (${app.client_id}) has null/undefined URL in allowed_logout_urls`);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
80
85
|
const subArr = insecurePatterns.filter((str) => url.includes(str));
|
|
81
86
|
if (subArr.length > 0) {
|
|
82
87
|
report.push({
|
package/package.json
CHANGED
|
@@ -146,4 +146,47 @@ describe("checkAllowedLogoutUrl", function () {
|
|
|
146
146
|
]);
|
|
147
147
|
});
|
|
148
148
|
});
|
|
149
|
+
|
|
150
|
+
it("should handle null/undefined URLs in allowed_logout_urls array without crashing", function () {
|
|
151
|
+
const options = {
|
|
152
|
+
clients: [
|
|
153
|
+
{
|
|
154
|
+
name: "Test App with Null URLs",
|
|
155
|
+
client_id: "client_with_null",
|
|
156
|
+
allowed_logout_urls: ["https://contoso.com", null, "http://localhost:3000", undefined], // Contains null and undefined
|
|
157
|
+
app_type: "spa",
|
|
158
|
+
is_first_party: false,
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
checkAllowedLogoutUrl(options, (reports) => {
|
|
164
|
+
// Should only process valid URLs and skip null/undefined
|
|
165
|
+
expect(reports).to.deep.equal([
|
|
166
|
+
{
|
|
167
|
+
name: "Test App with Null URLs (client_with_null)",
|
|
168
|
+
report: [
|
|
169
|
+
{
|
|
170
|
+
name: "Test App with Null URLs (client_with_null)",
|
|
171
|
+
client_id: "client_with_null",
|
|
172
|
+
field: "insecure_allowed_logout_urls",
|
|
173
|
+
value: "http://localhost:3000",
|
|
174
|
+
status: CONSTANTS.FAIL,
|
|
175
|
+
app_type: "spa",
|
|
176
|
+
is_first_party: false,
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "Test App with Null URLs (client_with_null)",
|
|
180
|
+
client_id: "client_with_null",
|
|
181
|
+
field: "secure_allowed_logout_urls",
|
|
182
|
+
status: CONSTANTS.SUCCESS,
|
|
183
|
+
value: "https://contoso.com",
|
|
184
|
+
app_type: "spa",
|
|
185
|
+
is_first_party: false,
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
]);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
149
192
|
});
|