diff --git a/src/index.ts b/src/index.ts index 3b5260d..09f5cae 100644 --- a/src/index.ts +++ b/src/index.ts @@ -26,12 +26,13 @@ const allowedOrigins: Array = [ "https://cultpodcasts.com", "http://localhost:4200", "https://local.cultpodcasts.com:4200", - "https://localhost:4200", - "https://feature-api-authorisation.website-83e.pages.dev" + "https://localhost:4200" ]; +const stagingHostSuffix= ".website-83e.pages.dev"; + function getOrigin(origin: string | null | undefined) { - if (origin == null || allowedOrigins.indexOf(origin.toLowerCase()) == -1) { + if (origin == null || (allowedOrigins.indexOf(origin.toLowerCase()) == -1 && !origin.endsWith(stagingHostSuffix))) { origin = allowedOrigins[0]; } return origin;