Skip to content

Commit

Permalink
sso error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pbc1017 committed Dec 19, 2023
1 parent 33f42be commit 96b9447
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
8 changes: 3 additions & 5 deletions back/routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ router.get("/callback", async (req, res) => {
try {
const userInfo = await client.getUserInfo(code, state);
res.redirect(
`https://clubs.sparcs.org/?userInfo=${JSON.stringify(userInfo)}`
`https://${process.env.FRONTEND_URL}/?userInfo=${JSON.stringify(
userInfo
)}`
);
} catch (error) {
res.send("Error: " + error.message);
Expand Down Expand Up @@ -61,8 +63,4 @@ router.get("/welcome", (req, res) => {
}
});

router.get("/front", async (req, res) => {
res.json({ front: process.env.FRONTEND_URL });
});

module.exports = router;
6 changes: 0 additions & 6 deletions front/src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ export const Home = (): JSX.Element => {
fetchData();
}, [location, login, navigate]);

useEffect(() => {
getRequest("auth/front", (data) => {
console.log(data);
});
}, []);

return (
<div className="home">
<div className="div-2">
Expand Down

0 comments on commit 96b9447

Please sign in to comment.