Skip to content

Commit

Permalink
Minor modifications in google callback URL
Browse files Browse the repository at this point in the history
  • Loading branch information
sikehish committed Jun 10, 2024
1 parent 888c596 commit 78c74e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 3 additions & 1 deletion backend/routes/oauthRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ router.get('/google/callback', passport.authenticate('google', { session: false,
});

// Redirect to the success URL
res.redirect(`${process.env.CLIENT_URL}/success`);
if(proces.env.NODE_ENV=="aws-eb") res.redirect(`/success`);
else res.redirect(`${process.env.CLIENT_URL}/success`);
} else {
// Redirect to the failure URL
f(proces.env.NODE_ENV=="aws-eb") res.redirect(`/failed`);
res.redirect(`${process.env.CLIENT_URL}/failed`);
}
});
Expand Down
11 changes: 5 additions & 6 deletions frontend/src/pages/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ function Login() {
};

console.log(import.meta.env.VITE_REACT_APP_API_URL)

const googleAuth = (e: any) => {
e.preventDefault()
// window.open(
// `http://localhost:3000/api/oauth/google/callback`,
// "_self"
// );
window.location="http://langjam.us-east-1.elasticbeanstalk.com/api/oauth/google/callback"
window.open(
`/api/oauth/google/callback`,
"_self"
);
};
// // OR //--> The below is returning undefined in Elastic Beanstalk
// const googleAuth = (e: any) => {
Expand Down

0 comments on commit 78c74e5

Please sign in to comment.