Skip to content

Commit

Permalink
hotfix : admin페이지 refresh_token, access_token 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
keemsebin committed Sep 9, 2024
1 parent c610222 commit 71f0d4c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/pages/admin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ export default function Index() {
const { data: noticedata } = useAllNotices();
const { data: documentData } = useAllDocuments();
const [infoElement, setInfoElement] = useState(<></>);
const [cookies, setCookie, removeCookie] = useCookies([
'access_token',
'refresh_token',
]);

const removeTokens = () => {
removeCookie('refresh_token');
removeCookie('access_token');
};

useEffect(() => {
if (cookies.refresh_token || cookies.access_token) {
removeTokens();
}
}, [cookies.refresh_token, cookies.access_token, removeTokens]);

const notices = noticedata?.data.sort((a, b) => {
return b.id - a.id;
Expand Down

0 comments on commit 71f0d4c

Please sign in to comment.