const handleAccountCreation = async () => { const exist = await userExistCheck(result.email) console.warn('social login', exist) if (exist.exist !== null) { socialLogin(result.email) console.warn('social login') } else { createAccount(result.email) console.warn('social create account') } }
La condition dans le if échoue si exist est null, car exist.exist reverra une erreur undefined.
Il faut mettre une condition autrement
const handleAccountCreation = async () => { const exist = await userExistCheck(result.email) console.warn('social login', exist) if (exist == null) { createAccount(result.email) console.warn('social login') } else { socialLogin(result.email) console.warn('social create account') } }