0
How to display a friendly message to the user when the login did not work, I tried several ways but could not. Only works if the email and password is correct.
const response = await api.post('/login', { email: email, senha: senha });
const { auth = false, token, msg } = response.data;
if (auth) {
await AsyncStorage.setItem('token', token);
navigation.navigate('Tarefas', { token: token });
} else {
Alert.alert('Erro de Login', 'Não foi possivel fazer o login');
setIsLoading(false)
}
thank you very much worked out
– Stewart Cintra