Login frontend complete

This commit is contained in:
2019-10-02 00:49:51 -04:00
parent 878bb28a71
commit dcd03d7888
6 changed files with 206 additions and 29 deletions

View File

@@ -121,11 +121,11 @@ exports.login = (req, res) => {
return data.user.getIdToken();
})
.then((token) => {
return res.json({ token });
return res.status(200).json({ token });
})
.catch((err) => {
console.error(err);
if (err.code === "auth/wrong-password") {
if (err.code === "auth/wrong-password" || err.code === "auth/invalid-email") {
return res
.status(403)
.json({ general: "Invalid credentials. Please try again." });