Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential dead code in LoginForm.js #1029

Open
TomBinford opened this issue Apr 17, 2023 · 0 comments
Open

Potential dead code in LoginForm.js #1029

TomBinford opened this issue Apr 17, 2023 · 0 comments

Comments

@TomBinford
Copy link
Contributor

const email = username + EMAIL_DOMAIN_NAME;
const passwordHash = SHA256(password).toString();
if (email && passwordHash) {
signInWithEmailAndPassword(email, passwordHash)
.then(() => {})
.catch((err) => {
console.error(err);
setErrorMsg(getCreateUserErrorMessage(err));
setWaiting(false);
});
} else {
setWaiting(false);
setErrorMsg('Failed to reach Firebase login services');
}
};

I don't see how the else branch could ever be taken, and why the error message references "Firebase login services" when it's just checking two strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant