diff --git a/src/assist/buttonwrapper/KakaoLoginButtonWrapper.tsx b/src/assist/buttonwrapper/KakaoLoginButtonWrapper.tsx index 23dc4aa..a8f301f 100644 --- a/src/assist/buttonwrapper/KakaoLoginButtonWrapper.tsx +++ b/src/assist/buttonwrapper/KakaoLoginButtonWrapper.tsx @@ -1,23 +1,18 @@ import LoginButton from "@modules/components/button/LoginButton"; import FlexBox from "@modules/layout/FlexBox"; -import { useEffect } from "react"; function KakaoLoginButtonWrapper() { const kakaoSDKLogin = () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any const kakao = (window as any).Kakao; + if (!kakao?.isInitialized()) { + kakao?.init(process.env.NEXT_PUBLIC_KAKAO_JS_KEY); + } const redirectUri = `https://api.eolluga.com/login/oauth2/code/kakao`; kakao?.Auth?.authorize({ redirectUri, }); }; - useEffect(() => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const kakao = (window as any)?.Kakao; - if (!kakao?.isInitialized()) { - kakao?.init(process.env.NEXT_PUBLIC_KAKAO_JS_KEY); - } - }, []); return (