Skip to content

Commit

Permalink
fix: useSearchParams가 서버에서 동작하지 않도록 Suspense로 감쌈
Browse files Browse the repository at this point in the history
  • Loading branch information
nebulaBdj committed Oct 26, 2024
1 parent 57acf0b commit 0dcb60d
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions src/app/auth/callback/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client'

import { useEffect } from 'react'
import { Suspense, useEffect } from 'react'
import { useSearchParams, useRouter } from 'next/navigation'
import { SendData } from './type'

export default function LoginCheck() {
function LoginCheck() {
const searchParams = useSearchParams()
const router = useRouter()

Expand Down Expand Up @@ -76,22 +76,10 @@ export default function LoginCheck() {
return <div>로그인 정보를 확인중입니다...</div>
}

// 카카오
// http://localhost:3000/auth/callback?
// code=ZZnujfZHgky0SJzoqbsnPu3y2TKkcfDvDbYNMleQV7tf_vIeY5YOYQAAAAQKKiUQAAABksnID2r7Ewsnpgvovw

// 만들어지는 url : https://cnergy.p-e.kr/v1/oauth/kakao?code=7wnKYOCgbr5DjoVxkYN_Pv-V02_ELWEZ4WCS1teNUrqx_R0C5_ZscAAAAAQKKw0eAAABksn8dLxPBWDH3LuH7A

// 구글
// http://localhost:3000/auth/callback?
// code=4%2F0AVG7fiTjjq1uNzs9UKtrmM3_BGeROe5RR0vGz3zYjrC1uw_qaSiOT3h1_FRVY-efhY_8Dw&
// scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&authuser=0&prompt=consent

// 만들어지는 url : https://cnergy.p-e.kr/v1/oauth/google?code=4/0AVG7fiSX5k6hZg5rq1Y0mmuDqWkq2BsO3KP4JI_5eUg53128M219Nk58taZ30Yq2Yk-Elw

// 네이버
// http://localhost:3000/auth/callback?
// code=3IgulvPnQhcdllTQZ2&
// state=7d0uu0g1bct5s0n3em5pitb457

// 만들어지는 url : https://cnergy.p-e.kr/oauth/login/naver?code=3IgulvPnQhcdllTQZ2&state=3IgulvPnQhcdllTQZ2
export default function WrappedLoginCheck() {
return (
<Suspense fallback={<div>로딩 중...</div>}>
<LoginCheck />
</Suspense>
)
}

0 comments on commit 0dcb60d

Please sign in to comment.