Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Luxshan2000 committed Oct 2, 2023
2 parents 2984dde + 20e933b commit f8005f7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
runs-on: aws-web-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
6 changes: 3 additions & 3 deletions backend/src/controllers/authController.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,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'
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/FacebookLoginButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f8005f7

Please sign in to comment.