Skip to content

Commit

Permalink
๐Ÿ› bug : ๋กœ๊ทธ์ธ ์‹œ๋„์ค‘ ...
Browse files Browse the repository at this point in the history
  • Loading branch information
seondal committed Feb 19, 2024
1 parent 0c1ab12 commit 62aeaf5
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/apis/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ export const usePoseFeedQuery = (
export const useFilterTagQuery = (options?: UseQueryOptions<FilterTagsResponse>) =>
useSuspenseQuery<FilterTagsResponse>(['filterTag'], getFilterTag, { ...options });

export const useRegisterQuery = (code: string) =>
useSuspenseQuery<RegisterResponse>(['register'], () => getRegister(code), {});
// export const useRegisterQuery = (code: string) =>
// useQuery<RegisterResponse>(['register'], () => getRegister(code));
2 changes: 1 addition & 1 deletion src/app/(Main)/mypose/components/LoginModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface LoginModalProps {
}

export default function LoginModal({ onClose }: LoginModalProps) {
const link = `https://kauth.kakao.com/oauth/authorize?client_id=${KAKAO_SERVER_KEY}&redirect_uri=${BASE_SITE_URL}/api/users/login/oauth/kakao&response_type=code`;
const link = `https://kauth.kakao.com/oauth/authorize?client_id=${KAKAO_SERVER_KEY}&redirect_uri=${BASE_SITE_URL}/auth&response_type=code`;

const handleLogin = () => {
window.location.href = link;
Expand Down
42 changes: 21 additions & 21 deletions src/app/(Sub)/api/users/login/oauth/kakao/page.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { QueryAsyncBoundary } from '@suspensive/react-query';
// import { QueryAsyncBoundary } from '@suspensive/react-query';

import LoginSection from './components/LoginSection';
import { getRegister } from '@/apis';
import { RejectedFallback } from '@/components/ErrorBoundary';
import { Loading } from '@/components/Loading';
import { HydrationProvider } from '@/components/Provider/HydrationProvider';
// import LoginSection from './components/LoginSection';
// import { getRegister } from '@/apis';
// import { RejectedFallback } from '@/components/ErrorBoundary';
// import { Loading } from '@/components/Loading';
// import { HydrationProvider } from '@/components/Provider/HydrationProvider';

interface PageProps {
searchParams: {
code: string;
};
}
// interface PageProps {
// searchParams: {
// code: string;
// };
// }

export default function Page({ searchParams }: PageProps) {
const { code } = searchParams;
// export default function Page({ searchParams }: PageProps) {
// const { code } = searchParams;

return (
<QueryAsyncBoundary rejectedFallback={RejectedFallback} pendingFallback={<Loading />}>
<HydrationProvider queryKey={['register']} queryFn={() => getRegister(code)}>
<LoginSection code={code} />
</HydrationProvider>
</QueryAsyncBoundary>
);
}
// return (
// <QueryAsyncBoundary rejectedFallback={RejectedFallback} pendingFallback={<Loading />}>
// <HydrationProvider queryKey={['register']} queryFn={() => getRegister(code)}>
// <LoginSection code={code} />
// </HydrationProvider>
// </QueryAsyncBoundary>
// );
// }
19 changes: 19 additions & 0 deletions src/app/auth/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use client';

import { useEffect } from 'react';

import { getRegister } from '@/apis';

interface PageProps {
searchParams: {
code: string;
};
}

export default function Page({ searchParams }: PageProps) {
// useEffect(() => {
// getRegister(searchParams.code);
// });

return <>Loading...</>;
}

0 comments on commit 62aeaf5

Please sign in to comment.