Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const kakaoLogin = () => {
logCallback('Login Start', setLoginLoading(true));
KakaoLogins.login()
.then(result => {
setToken(result.accessToken);
logCallback(
`Login Finished:${JSON.stringify(result)}`,
setLoginLoading(false),
);
})
.catch(err => {
if (err.code === 'E_CANCELLED_OPERATION') {
logCallback(`Login Cancelled:${err.message}`, setLoginLoading(false));
} else {
logCallback(
`Login Failed:${err.code} ${err.message}`,
setLoginLoading(false),
);
}