'Chrome show a sign up alert even if there is no alert in the code
I'm developing a web app using react, I'm facing an annoying bug. When I log in with incorrect credentials, an alert appears on the screen asking me to enter my credentials, the problem is that this alert is displayed only using chrome and that there is no alert on the code ... I leave you the photo of the alert below
This is my Login Api
const doLogin = (evt: FormEvent) => {
evt.preventDefault();
setErrorMessage('');
if (userData.username !== '' && userData.password !== '') {
setIsProcessingLogin(true);
doPostData('/auth/login', {}, {
auth: {
username: userData.username,
password: userData.password
}
})
.then((result: LoginResponse) => {
const user = TokenDecode(result.tokens.accessToken, result.tokens.refreshToken);
if (user) {
dispatch(setAuthToken(user));
}
navigate("/companies");
})
.catch(e => {
let message = '';
if(e?.response?.status === 400){
message = t("error.badRequest");
}
if(e?.response?.status === 500){
message = t("login.error.internalServer");
}
if(e?.response?.status === 401){
message = t("login.error.unauthorized");
}
console.error("ERROR", message);
setErrorMessage(message);
}).finally(() => {
setIsProcessingLogin(false)
});
} else {
setErrorMessage(t("login.error.credentials"));
}
};
Thank you all.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

