Skip to content

Commit

Permalink
feat: add staging environment check for Auth0 redirect URI
Browse files Browse the repository at this point in the history
  • Loading branch information
amalv committed Jan 9, 2024
1 parent df04c35 commit 8daa979
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

1 comment on commit 8daa979

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.