Skip to content

Commit 11354aa

Browse files
committed
1
1 parent 8a7443e commit 11354aa

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

components/server/src/express-util.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,12 @@ export function validateReturnToUrlWithPatterns(
191191
return url.pathname === "/";
192192
}
193193

194-
// Check if pathname matches any allowed pattern
195-
const isAllowedPath = allowedPatterns.some((pattern) => pattern.test(url.pathname));
196-
if (!isAllowedPath) {
197-
return false;
194+
if (allowedPatterns && allowedPatterns.length != 0) {
195+
// Check if pathname matches any allowed pattern
196+
const isAllowedPath = allowedPatterns.some((pattern) => pattern.test(url.pathname));
197+
if (!isAllowedPath) {
198+
return false;
199+
}
198200
}
199201

200202
// For complete-auth, require ONLY message parameter (used by OAuth flows)

0 commit comments

Comments
 (0)