Skip to content

Commit

Permalink
Gère correctement le renvoi vers l'authentification pour l'instance d…
Browse files Browse the repository at this point in the history
…e preprod
  • Loading branch information
marc-rutkowski committed Mar 4, 2024
1 parent 936bcb8 commit d39a90c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/api/src/utils/pathUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ export const getRootDomain = (hostname: string) => {
const DEV_SITE_PORT = 3001;
export const getBaseUrlSite = (hostname: string) => {
const domain = getRootDomain(hostname);
const protocol = document.location.protocol;
const protocol = domain === 'localhost' ? 'http' : 'https';
const subdomain = domain === 'koyeb.app' ? 'preprod-site-tet.' : '';
const port = domain === 'localhost' ? `:${DEV_SITE_PORT}` : '';
return `${protocol}//${domain}${port}`;
return `${protocol}//${subdomain}${domain}${port}`;
};

/**
Expand Down

0 comments on commit d39a90c

Please sign in to comment.