Skip to content

Commit

Permalink
chore: 콘솔 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
urjimyu committed May 27, 2024
1 parent b6df790 commit 99646b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/hooks/queries/usePostKakao.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const usePostKakao = () => {
console.log('data', data);
setKakaoResponse(data.data);
// console.log('응답이 왔나요?', kakaoResponse);
// localStorage.setItem('ACCESS_TOKEN', data.data.accessToken);
// localStorage.setItem('REFRESH_TOKEN', data.data.refreshToken);
localStorage.setItem('ACCESS_TOKEN', data.data.accessToken);
localStorage.setItem('REFRESH_TOKEN', data.data.refreshToken);
} catch (err) {
setKakaoError(err as AxiosError);
console.log('에러 발생', err);
Expand Down
4 changes: 3 additions & 1 deletion src/pages/KakaoLoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const KakaoLoginPage = () => {
const res = await useGetToken();
if (res) {
const token = res.data.access_token;

console.log('token 잘 왔나요?', token);
// localStorage.setItem('ACCESS_TOKEN', JSON.stringify(token));
// await handlePostKakao(token);
await postKakao(token);
Expand All @@ -29,10 +29,12 @@ const KakaoLoginPage = () => {

useEffect(() => {
fetchLogin();
console.log('몇 번 불리는지');
}, [fetchLogin]);

useEffect(() => {
if (!kakaoLoading && kakaoResponse) {
console.log('여기서는 잘 들어오나?', kakaoResponse);
if (kakaoResponse.isAlreadyUser) {
navigate('/delete');
} else {
Expand Down

0 comments on commit 99646b5

Please sign in to comment.