diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bcba2b7..f29faeb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,7 @@ jobs: VITE_API_URL_PRODUCTION: ${{ secrets.VITE_API_URL_PRODUCTION }} VITE_AUTH0_DOMAIN: ${{ secrets.VITE_AUTH0_DOMAIN_STAGING }} VITE_AUTH0_CLIENT_ID: ${{ secrets.VITE_AUTH0_CLIENT_ID_STAGING }} + VITE_ENV: staging - name: Deploy to Netlify id: deploy uses: nwtgck/actions-netlify@v2.0 diff --git a/src/App.tsx b/src/App.tsx index 74cf6bf..889ada3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,9 +8,11 @@ import { client } from "./apolloClient"; const getRedirectUri = () => { const isProduction = process.env.NODE_ENV === "production"; - return isProduction - ? `${window.location.origin}/bukie` - : window.location.origin; + const isStaging = import.meta.env.VITE_ENV === "staging"; + if (isProduction && !isStaging) { + return `${window.location.origin}/bukie`; + } + return window.location.origin; }; const App = () => { const theme = useTheme();