In logic.js
|
} else { |
|
console.log("XHR error", xhr.status); |
|
} |
- I would change your callback functions (such as
setStorage()) to become error first and display it to the user.
In handler.js:
|
bcrypt.genSalt(10, (err, salt) => { |
|
if (err) console.log(err); |
|
if (err || !decoded) { |
|
// if not logged in |
|
console.log(err); |
In addition console.log(error), may I suggest also sending something back to the user (like you have done for some others) e.g.:
res.writeHead(500, 'Content-Type:text/html');
res.end('<h1>Sorry, there was a problem on our side<h1>');
Since you'll be using this multiple times, perhaps have it has a function that you re-use (with an argument if you wanted to pass in a custom message).
In
logic.jsToVaHayGi/public/logic.js
Lines 12 to 14 in 4b3cf6e
setStorage()) to become error first and display it to the user.In
handler.js:ToVaHayGi/src/handler.js
Lines 148 to 149 in 4b3cf6e
ToVaHayGi/src/handler.js
Lines 39 to 41 in 4b3cf6e
In addition
console.log(error), may I suggest also sending something back to the user (like you have done for some others) e.g.:Since you'll be using this multiple times, perhaps have it has a function that you re-use (with an argument if you wanted to pass in a custom message).