-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from Kernel360/page-map-marker
페이지 기능: 카카오 인가 코드 페이지 제작
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use client'; | ||
|
||
import { useCallback, useEffect } from 'react'; | ||
|
||
import { useSearchParams } from 'next/navigation'; | ||
|
||
import { getRequest } from '@/remote/api/requests/requests.api'; | ||
|
||
function KakaoPage() { | ||
const searchParams = useSearchParams(); | ||
const code = searchParams.get('code'); | ||
/* eslint-disable no-console */ | ||
console.log(code); | ||
|
||
const loginHandler = useCallback( | ||
async (authCode: string) => { | ||
// 백엔드에 전송 | ||
const response = await getRequest('/member/login/forKakao', { | ||
method: 'get', | ||
headers: { | ||
Authorization: authCode, | ||
}, | ||
}); | ||
|
||
return response; | ||
}, | ||
[], | ||
); | ||
|
||
useEffect(() => { | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
loginHandler(code!); | ||
}, [code, loginHandler]); | ||
return ( | ||
<div /> | ||
); | ||
} | ||
|
||
export default KakaoPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters