Skip to content

Commit

Permalink
feat: 토큰 상태 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kanghaeun committed Jul 23, 2024
1 parent c698f03 commit 80251ab
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions FE/error/src/components/EconoCalendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const EconoCalendar = ({ isLoggedIn, setIsLoggedIn }) => {
const [checkModalIsOpen, setCheckModalIsOpen] = useState(false);
const [createModalIsOpen, setCreateModalIsOpen] = useState(false);
const [selectedDate, setSelectedDate] = useState("");

const [token, setToken] = useState(null);
useEffect(() => {
const storedToken = localStorage.getItem("slackToken");

Expand Down Expand Up @@ -87,16 +87,16 @@ const EconoCalendar = ({ isLoggedIn, setIsLoggedIn }) => {
localStorage.removeItem("slackToken");
setIsLoggedIn(false);
setToken(null);
// } else {
// const newToken = "dummyToken" + Math.random().toString(36).substr(2, 9); // 임의의 토큰 생성
// localStorage.setItem("slackToken", newToken);
// setToken(newToken);
// setIsLoggedIn(true);
// }
//TODO: 추후 아래 코드로 변경
} else {
const newToken = "dummyToken" + Math.random().toString(36).substr(2, 9); // 임의의 토큰 생성
localStorage.setItem("slackToken", newToken);
setToken(newToken);
setIsLoggedIn(true);
window.location.href = "/login";
}
//TODO: 추후 아래 코드로 변경
// } else {
// window.location.href = "/login";
// }
};

return (
Expand Down

0 comments on commit 80251ab

Please sign in to comment.