Skip to content

Commit

Permalink
test: 로그인 x-form-urlencoded로 변경 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
bbearcookie committed Nov 21, 2023
1 parent 8206051 commit 9da7d49
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions src/pages/JoinKakaoPage.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
import { useEffect } from 'react';
import { useSearchParams } from 'react-router-dom';
import { useMutation } from '@tanstack/react-query';
import axios from 'axios';
import memberAPI from '@/core/api/functions/memberAPI';
import { useMoveRoute } from '@/core/hooks';
import { LoadingSpinner } from '@/shared/LoadingSpinner';

const temporalPost = async (code: string) => {
console.lpog(code);

Check failure on line 10 in src/pages/JoinKakaoPage.tsx

View workflow job for this annotation

GitHub Actions / build

Property 'lpog' does not exist on type 'Console'. Did you mean 'log'?

return await axios.post(
'https://dev-api.moabam.com/members/login/kakao/oauth',
{
code
},
{
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
withCredentials: true
}
);
};

const JoinKakaoPage = () => {
const [searchParams] = useSearchParams();
const code = searchParams.get('code');
Expand All @@ -15,16 +33,19 @@ const JoinKakaoPage = () => {
});

useEffect(() => {
mutate(
{ code: code ?? '' },
{
onSuccess: ({ signUp }) => {
moveTo(signUp ? 'guide' : 'start');
}
}
);
// mutate(
// { code: code ?? '' },
// {
// onSuccess: ({ signUp }) => {
// moveTo(signUp ? 'guide' : 'start');
// }
// }
// );
temporalPost(code ?? '');
}, []);

return <div>application/x-www-form-urlencoded 로 테스트중</div>;

return (
<div className="flex h-full items-center justify-center">
{isPending && (
Expand Down

0 comments on commit 9da7d49

Please sign in to comment.