fixed js logic for errors

This commit is contained in:
2018-11-17 23:59:57 +01:00
parent c63274f7a9
commit 9dca27177f
2 changed files with 3 additions and 3 deletions

View File

@@ -34,10 +34,10 @@ function send()
if (xhr.readyState !== 4) return;
console.log('Status: ' + xhr.status);
if (xhr.status === 200)
if (xhr.status === 200 || xhr.status === 401 || xhr.status === 403 || xhr.status === 412)
{
let resp = JSON.parse(xhr.responseText);
if (!resp.success)
if (!resp.success || xhr.status !== 200)
{
if (resp.errhighlight === 101) uid.classList.add('input-invalid');
if (resp.errhighlight === 102) key.classList.add('input-invalid');