Skip to content

Commit

Permalink
로그인 빈칸 입력 시 로그인 되는 거 수정, 마이페이지에서 로그아웃시 모달창 수정뜨는 거
Browse files Browse the repository at this point in the history
  • Loading branch information
junanida committed May 22, 2024
1 parent 23cc668 commit 610265e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/views/component/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ function Header() {

// 로그아웃 함수
function handleLogoutClick() {
window.location.href = "/";
if (cookies.socialToken) {
removeCookie("socialToken", { path: "/", domain: "vivi-o.site" });
removeCookie("token", { path: "/", domain: "www.vivi-o.site" });
} else {
removeCookie("token", { path: "/", domain: "vivi-o.site" });
}
// 쿠키에서 토큰을 제거하고 사용자 상태를 업데이트합니다.
window.location.href = "/";
}

function handleGuideClick() {
Expand Down
6 changes: 3 additions & 3 deletions src/views/page/LoginPage/LoginPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ function Home() {

// 이메일이랑 비밀번호 넘기고, 토큰 받기
function onClickLogin() {
if (!(email === "" && password === "")) {
if (email === "" || password === "") {
alert("이메일 또는 비밀번호를 입력해주세요");
} else {
axios
.post("https://backend.vivi-o.site/users/signin", {
email: email,
Expand All @@ -109,8 +111,6 @@ function Home() {
alert("로그인이 실패. 이메일과 비밀번호를 확인해주세요");
}
});
} else {
alert("이메일 또는 비밀번호를 입력해주세요");
}
}

Expand Down

0 comments on commit 610265e

Please sign in to comment.