mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-28 22:00:51 +00:00
update cors to check array
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@ function parseSetCookieString(
|
||||
: new URL(env.app.dashboardUrl).hostname;
|
||||
if (d) {
|
||||
options.domain = d;
|
||||
console.log("Setting cookie domain to:", d);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user