Skip to content

Commit

Permalink
Merge pull request #127 from IT-Cotato/feat/#116
Browse files Browse the repository at this point in the history
[FEAT]  임시 로그아웃 구현
  • Loading branch information
Ki-Tak authored Feb 20, 2025
2 parents ae81f0f + 61861ee commit 66f0f17
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/my/mypage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import notification from '@/assets/imgs/notification.svg';
import arrow from '@/assets/imgs/arrowRight.svg';
import { useNavigate } from 'react-router-dom';
import { path } from '@/routes/path';
import { removeTokens } from '@/utils/authUtils';

export const MyPage = () => {
const navigate = useNavigate();
Expand All @@ -10,6 +11,10 @@ export const MyPage = () => {
const username = 'COTATO';
const university = 'Cotato University';

const handleLogout = async () => {
await removeTokens();
navigate(path.login);
}
return (
<div className="flex h-full w-full flex-col gap-[1.125rem] p-4">
{/* 알림 영역 */}
Expand Down Expand Up @@ -140,7 +145,7 @@ export const MyPage = () => {
<button
type="button"
className="text-left"
onClick={() => navigate('/')}
onClick={() => handleLogout()}
>
Log Out
</button>
Expand Down

0 comments on commit 66f0f17

Please sign in to comment.