인터넷에 있는 예제를 보고 따라하고 있는데, 에러가 발생했다.
import GoogleLogin from "react-google-login";
const clientId: string = process.env.REACT_APP_GOOGLE_OAUTH_CLIENT_KEY ?? "";
export default function GoogleButton(params: { onGoogleLogin: Function }) {
const onSuccess = async (response: any) => {
const {
googleId,
profileObj: { email, name },
} = response;
await params.onGoogleLogin({
socialId: googleId,
socialType: "google",
email,
nickname: name,
});
};
const onFailure = (error: any) => {
console.log(error);
};
return (
<div>
<GoogleLogin
clientId={clientId}
responseType={"id_token"}
onSuccess={onSuccess}
onFailure={onFailure}
/>
</div>
);
}
/*
26번째 줄 Error
details: "
You have created a new client application that uses libraries for user authentication or authorization
that will soon be deprecated. New clients must use the new libraries instead; existing clients must also
migrate before these libraries are deprecated. See the [Migration Guide]
(https://developers.google.com/identity/gsi/web/guides/gis-migration)
for more information.
"
error: "idpiframe_initialization_failed"
*/
- 26번째 줄에서 에러를 뿜어내고 있다.
다른 사이트에서의 해결 방법은, 캐시를 지우라고 설명해주었고, 웹이 아닌 Electron을 사용하고 있어 가능한 방법을 찾아보았다.
C:\Users\<user>\AppData\Roaming\<yourAppName>\Cache
Cache_Data 폴더가 존재했고, 해당 파일을 삭제하였음
그리고 까먹었음