From 2ea0a9d854f121ebcf780f02312f58442cebca20 Mon Sep 17 00:00:00 2001 From: LuxShan Thavarasa <120371059+Luxshan2000@users.noreply.github.com> Date: Sat, 30 Sep 2023 22:48:11 +0530 Subject: [PATCH 1/3] Update workflow.yml --- .github/workflows/workflow.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0180c31..a02e19b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -17,9 +17,9 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build Docker frontend image - run: docker build -t luxshan/drivesmart-frontend ./webapp + run: docker build -t drivesmart/drivesmart-frontend ./webapp - name: Publish frontend image to Docker Hub - run: docker push luxshan/drivesmart-frontend + run: docker push drivesmart/drivesmart-frontend build-backend: runs-on: ubuntu-latest @@ -32,23 +32,23 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build Docker backend image - run: docker build -t luxshan/drivesmart-backend ./backend + run: docker build -t drivesmart/drivesmart-backend ./backend - name: Publish backend image to Docker Hub - run: docker push luxshan/drivesmart-backend + run: docker push drivesmart/drivesmart-backend deploy: needs: [build-frontend, build-backend] runs-on: aws-ec2 steps: - name: Pull frontend image from Docker Hub - run: docker pull luxshan/drivesmart-frontend + run: docker pull drivesmart/drivesmart-frontend - name: Pull backend image from Docker Hub - run: docker pull luxshan/drivesmart-backend + run: docker pull drivesmart/drivesmart-backend - name: Delete old frontend container run: docker rm -f drivesmart-frontend-container - name: Delete old backend container run: docker rm -f drivesmart-backend-container - name: Run frontend container - run: docker run -d -p 3000:3000 --name drivesmart-frontend-container luxshan/drivesmart-frontend + run: docker run -d -p 3000:3000 --name drivesmart-frontend-container drivesmart/drivesmart-frontend - name: Run backend container - run: docker run -d -p 5000:5000 --name drivesmart-backend-container luxshan/drivesmart-backend + run: docker run -d -p 5000:5000 --name drivesmart-backend-container drivesmart/drivesmart-backend From cb2c5806e1a133570522c2f3b7134a2b9889ae3a Mon Sep 17 00:00:00 2001 From: LuxShan Thavarasa <120371059+Luxshan2000@users.noreply.github.com> Date: Mon, 2 Oct 2023 00:19:37 +0530 Subject: [PATCH 2/3] Update workflow.yml --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index a02e19b..737ea6f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -38,7 +38,7 @@ jobs: deploy: needs: [build-frontend, build-backend] - runs-on: aws-ec2 + runs-on: aws-web-ec2 steps: - name: Pull frontend image from Docker Hub run: docker pull drivesmart/drivesmart-frontend From 20e933b513e2d90443089665d8f3dc7b2f9507da Mon Sep 17 00:00:00 2001 From: kamadi2000 Date: Mon, 2 Oct 2023 15:14:50 +0530 Subject: [PATCH 3/3] update in facebook login --- backend/src/controllers/authController.js | 6 +++--- webapp/src/components/FacebookLoginButton.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/controllers/authController.js b/backend/src/controllers/authController.js index d610812..f557987 100644 --- a/backend/src/controllers/authController.js +++ b/backend/src/controllers/authController.js @@ -155,10 +155,10 @@ const googleLoginBase = async (req, res, isWeb) => { } exports.facebooklogin = async ( req,res) => { - const { token } = req.body - console.log({ token }) + const { token , userID } = req.body + console.log({ token , userID }) //verfication of user by fetching user information from google - const facebookResponse = await fetch('https://graph.facebook.com/USER-ID?metadata=1', { + const facebookResponse = await fetch(`https://graph.facebook.com/${userID}?fields=id,name,email&access_token=${token}`, { method: "GET", headers: { Authorization: `Bearer ${token}`, Accept: 'application/json' diff --git a/webapp/src/components/FacebookLoginButton.js b/webapp/src/components/FacebookLoginButton.js index cb5a303..c56a166 100644 --- a/webapp/src/components/FacebookLoginButton.js +++ b/webapp/src/components/FacebookLoginButton.js @@ -3,7 +3,7 @@ import axios from 'axios'; const FacebookLoginButton = () => { const responseMessage = (response) => { console.log(response) - axios.post('http://localhost:5000/api/auth/facebookLogin', { token: response.accessToken }) + axios.post('http://localhost:5000/api/auth/facebookLogin', { token: response.accessToken , userID : response.userID }) .then(response => { // Handle the successful response here console.log(response.data);