Skip to content

Commit

Permalink
[FEAT] 로그아웃시 로컬스토리지의 엑세스토큰, 리프레시토큰 전달
Browse files Browse the repository at this point in the history
  • Loading branch information
boeunLee committed Jun 14, 2024
1 parent 762eb6a commit a58f658
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/Logout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { useNavigate } from 'react-router-dom';
import { magazineTokenState } from '../recoil/atom';
import { adminLogout } from '../lib/api/login';
import { styled } from 'styled-components';
import { getAccessToken, getRefreshToken } from '../lib/token';

const Logout = () => {
const resetToken = useResetRecoilState(magazineTokenState);
const token = useRecoilValue(magazineTokenState);
const params = new TokenDto();
const navigate = useNavigate();
const handleClickLogout = async () => {
params.accessToken = token.accessToken;
params.refreshToken = token.refreshToken;
params.accessToken = getAccessToken('accessToken');
params.refreshToken = getRefreshToken('refreshToken');
await adminLogout(params);
resetToken();
navigate('/');
Expand Down

0 comments on commit a58f658

Please sign in to comment.