Skip to content

Commit

Permalink
Add staging environment (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: Jon Breen <[email protected]>
  • Loading branch information
cultpodcasts and cultpodcasts committed Jun 17, 2024
1 parent dad529f commit aa343b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ const allowedOrigins: Array<string> = [
"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;
Expand Down

0 comments on commit aa343b1

Please sign in to comment.