update cors to check array

This commit is contained in:
miloschwartz
2025-10-05 16:50:46 -07:00
parent 956869ab58
commit b167d94ead
2 changed files with 7 additions and 1 deletions

View File

@@ -78,6 +78,13 @@ export function corsWithLoginPageSupport(corsConfig: any) {
return callback(null, true);
}
if (
corsConfig?.origins &&
corsConfig.origins.includes(origin)
) {
return callback(null, true);
}
// If origin doesn't match dashboard URL, check if it's a valid loginPage domain
const isValidDomain = await isValidLoginPageDomain(originHost);