Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Luxshan2000 committed Nov 1, 2023
2 parents cecd850 + 84df1bd commit 4358c71
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const PORT = process.env.PORT || 5000;

app.use(
cors({
origin: ["http://18.61.20.118:3000", "http://18.61.20.118:3001","*","http://18.61.20.118", "https://drivesmart-w549.onrender.com/","http://drivesmart.tracktechlk.com","http://localhost:3000"],
origin: ["http://18.61.20.118:3000", "http://18.61.20.118:3001","*","http://18.61.20.118", "https://drivesmart-w549.onrender.com","http://drivesmart.tracktechlk.com","http://localhost:3000"],
methods: ["POST", "GET"],
credentials: true,
})
Expand Down
4 changes: 3 additions & 1 deletion backend/src/controllers/authController.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ const googleLoginBase = async (req, res, isWeb) => {
Authorization: `Bearer ${token}`,
},
}
)
).catch(err => {
console.log(err)
})
console.log(googleResponse.data);
const { email, name } = googleResponse.data;
//see if there is an user with that email already
Expand Down
4 changes: 3 additions & 1 deletion webapp/src/components/GoogleLoginButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ function GoogleLoginButton() {
axios.post(url, { token: response.access_token })
.then(response => {
// Handle the successful response here
console.log(response.data);
// console.log(response.data);
// alert('login successful')
localStorage.setItem('token' , response.newToken)
console.log(response.newToken)
navigate('/dashboard',{replace : true})
})
.catch(error => {
Expand Down

0 comments on commit 4358c71

Please sign in to comment.