Skip to content

Commit

Permalink
configurable mtfsz api url
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschonti committed Sep 8, 2024
1 parent 472fa89 commit 9ebf673
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/azure-swa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ jobs:
runs-on: ubuntu-latest
name: Build and Deploy Job
env:
VITE_FUNC_HOST: https://pontozo-api.azurewebsites.net
VITE_APIM_HOST: https://pontozoapim.azure-api.net
VITE_FUNC_HOST: ${{ secrets.FUNC_HOST }}
VITE_APIM_HOST: ${{ secrets.APIM_HOST }}
VITE_MTFSZ_API_URL: ${{ secrets.MTFSZ_API_URL }}
VITE_APIM_KEY: ${{ secrets.APIM_KEY }}
VITE_CLIENT_ID: ${{ secrets.CLIENT_ID }}
VITE_APP_INSIGHTS_CONN_STR: ${{ secrets.APP_INSIGHTS_CONN_STR}}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
env:
VITE_FUNC_HOST: ${{ secrets.FUNC_HOST }}
VITE_APIM_HOST: ${{ secrets.APIM_HOST }}
VITE_MTFSZ_API_URL: ${{ secrets.MTFSZ_API_URL }}
VITE_APIM_KEY: ${{ secrets.APIM_KEY }}
VITE_CLIENT_ID: ${{ secrets.CLIENT_ID }}
VITE_APP_INSIGHTS_CONN_STR: ${{ secrets.APP_INSIGHTS_CONN_STR}}
Expand Down
1 change: 1 addition & 0 deletions packages/client/src/util/environment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const FUNC_HOST = import.meta.env.VITE_FUNC_HOST || 'http://localhost:3000'
export const APIM_HOST = import.meta.env.VITE_APIM_HOST || 'https://pontozoapim.azure-api.net'
export const MTFSZ_API_URL = import.meta.env.VITE_MTFSZ_API_URL
export const APIM_KEY = import.meta.env.VITE_APIM_KEY
export const CLIENT_ID = import.meta.env.VITE_CLIENT_ID
export const APP_INSIGHTS_CONN_STR = import.meta.env.VITE_APP_INSIGHTS_CONN_STR
4 changes: 2 additions & 2 deletions packages/client/src/util/onLoginClick.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CLIENT_ID, FUNC_HOST } from './environment'
import { CLIENT_ID, FUNC_HOST, MTFSZ_API_URL } from './environment'

export const onLoginClick = () => {
window.location.href = `https://api.mtfsz.hu/oauth/v2/auth?client_id=${CLIENT_ID}&scope=&redirect_uri=${FUNC_HOST}/auth/callback&response_type=code`
window.location.href = `${MTFSZ_API_URL}/oauth/v2/auth?client_id=${CLIENT_ID}&scope=&redirect_uri=${FUNC_HOST}/auth/callback&response_type=code`
}

0 comments on commit 9ebf673

Please sign in to comment.