From d7e2ebc4cc9f4dc93a08279a10dbcec56bf582e9 Mon Sep 17 00:00:00 2001 From: Dario Date: Fri, 8 Mar 2024 18:06:05 +0100 Subject: [PATCH] fix: env variables --- .github/workflows/release.yml | 4 ++++ webapp/src/components/auth/AuthUtils.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6208b027..4556ab14 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -100,9 +100,13 @@ jobs: key: ${{ secrets.DEPLOY_KEY }} command: | git clone https://github.com/Arquisoft/wiq_en2b.git + git pull cd wiq_en2b echo "DATABASE_USER=${{ secrets.DATABASE_USER }}" >> .env echo "DATABASE_PASSWORD=${{ secrets.DATABASE_PASSWORD }}" >> .env echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> .env + cd webapp + echo "REACT_APP_API_ENDPOINT=http://${{ secrets.DEPLOY_HOST }}:8080" >> .env + cd ../ sudo docker compose down sudo docker compose --profile prod up -d diff --git a/webapp/src/components/auth/AuthUtils.js b/webapp/src/components/auth/AuthUtils.js index 296fb582..78bc0edf 100644 --- a/webapp/src/components/auth/AuthUtils.js +++ b/webapp/src/components/auth/AuthUtils.js @@ -22,7 +22,7 @@ export function getLoginData() { export async function login(loginData, onSuccess, onError) { try { let requestAnswer = await axios.post(process.env.REACT_APP_API_ENDPOINT - + process.env.REACT_APP_LOGIN_ENDPOINT, loginData); + + "/auth/login", loginData); if (HttpStatusCode.Ok === requestAnswer.status) { saveToken(requestAnswer); onSuccess();