Skip to content

Commit

Permalink
Merge pull request #26 from TeamRecorDream/develop
Browse files Browse the repository at this point in the history
Develop => main ๋จธ์ง€
  • Loading branch information
urjimyu authored May 26, 2024
2 parents 5fdd809 + ab2f6fc commit c3e0233
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/hooks/queries/usePostKakao.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ const usePostKakao = () => {
nickname: data.data.nickname,
});
console.log('์‘๋‹ต์ด ์™”๋‚˜์š”?', kakaoResponse);
localStorage.setItem('accessToken', data.data.accessToken);
localStorage.setItem('ACCESS_TOKEN', data.data.accessToken);
localStorage.setItem('REFRESH_TOKEN', data.data.refreshToken);
} catch (err) {
setKakaoError(err as AxiosError);
console.log('์—๋Ÿฌ ๋ฐœ์ƒ', err);
} finally {
setKakaoLoading(false);
}
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/DeleteLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface DeleteLayoutInterface {

const DeleteLayout = ({ iconOn, btnColor, btnMessage }: DeleteLayoutInterface) => {
const { deleteUser } = useDeleteUser();
const accessToken = localStorage.getItem('accessToken');
const accessToken = localStorage.getItem('ACCESS_TOKEN');

console.log('ACCESSTOKEn', accessToken);
if (!accessToken) {
Expand Down
9 changes: 7 additions & 2 deletions src/pages/KakaoLoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ const KakaoLoginPage = () => {
try {
await postKakao(code);
if (!kakaoError && !kakaoLoading && kakaoResponse) {
navigate('/delete');
console.log('์ด๋™ ์ „ ์ฝ˜์†” ์ฐํžˆ๋Š”์ง€ ํ™•์ธ', kakaoResponse);
if (kakaoResponse.isAlreadyUser) {
navigate('/delete');
} else {
navigate('/unregistered');
}
}
} catch (error) {
navigate('/unregistered');
Expand All @@ -29,7 +34,7 @@ const KakaoLoginPage = () => {
.then((res) => {
if (res) {
const token = res.data.access_token;
localStorage.setItem('token', JSON.stringify(token));
// localStorage.setItem('ACCESS_TOKEN', JSON.stringify(token));
handlePostKakao(token);
}
})
Expand Down

0 comments on commit c3e0233

Please sign in to comment.