This commit is contained in:
fkereki
2018-05-31 22:56:34 -04:00
parent aa55bb9c30
commit 233a44c744
17 changed files with 1785 additions and 38 deletions
+3 -1
View File
@@ -13,7 +13,9 @@ const validateUser = (
password: string,
callback: (?string, ?string) => void
) => {
if (userName === "fkereki" && password === "modernjsbook") {
if (!userName || !password) {
callback("Missing user/password", null);
} else if (userName === "fkereki" && password === "modernjsbook") {
callback(null, "fkereki"); // OK, send userName back
} else {
callback("Not valid user", null);