Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
timgl committed Dec 17, 2023
1 parent 3fb1e86 commit 272363c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const PH_CURRENT_INSTANCE = 'ph_current_instance'

const REDIRECT_TIMEOUT = 2500

type Subdomain = 'eu' | 'app'
type Subdomain = 'eu' | 'us'

export function cleanedCookieSubdomain(loggedInInstance: string | null): Subdomain | null {
try {
Expand All @@ -42,10 +42,10 @@ export function cleanedCookieSubdomain(loggedInInstance: string | null): Subdoma
// convert to URL, so that we can be sure we're dealing with a valid URL
const hostname = new URL(url).hostname
switch (hostname) {
case 'app.posthog.com':
return 'app'
case 'eu.posthog.com':
return 'eu'
case 'us.posthog.com':
return 'us'
default:
return null
}
Expand All @@ -58,7 +58,7 @@ export function cleanedCookieSubdomain(loggedInInstance: string | null): Subdoma

function regionFromSubdomain(subdomain: Subdomain): 'EU' | 'US' {
switch (subdomain) {
case 'app':
case 'us':
return 'US'
case 'eu':
return 'EU'
Expand Down

0 comments on commit 272363c

Please sign in to comment.