Skip to content

Commit

Permalink
feat: navigate 경로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Turtle-Hwan committed Aug 20, 2024
1 parent cc635c3 commit d8c5856
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function App() {
const routes_children_login = [
{ path: "/login", element: <LoginPage />, hasBottombar: false },
{ path: "/signup", element: <SignUpPage />, hasBottombar: false },
{ path: "/kakao/callback", element: <KakaoRedirection />, hasBottombar: true },
{ path: "/oauth/callback/kakao", element: <KakaoRedirection />, hasBottombar: true },
];

const routes_children = [
Expand Down
7 changes: 6 additions & 1 deletion src/pages/LoginPage/KakaoRedirection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ const KakaoRedirection = () => {
const code = new URL(document.location.toString()).searchParams.get("code");
kakaoLoginApi(code ?? "").then((res) => {
console.log(res);
navigate("/");
if (res.status === "OK") {
navigate("/space");
} else {
alert("login 실패! : " + res.message);
navigate("/login");
}
});
}, [navigate]);

Expand Down

0 comments on commit d8c5856

Please sign in to comment.