diff --git a/src/oidc_templates/login.ejs b/src/oidc_templates/login.ejs index 711943d06..50970199d 100644 --- a/src/oidc_templates/login.ejs +++ b/src/oidc_templates/login.ejs @@ -123,18 +123,16 @@ document.getElementById('loginForm').addEventListener('submit', function (event) return res.json(); // we always return objects }).then(function (data) { if (res.status === 401) { - if (data.message === 'Username and password does not match') { - document.getElementById('inputPassword').value = ''; - document.getElementById('inputPassword').focus(); - document.getElementById('passwordError').classList.remove('hide'); - return; - } else if (data.message.indexOf('totpToken') !== -1) { + if (data.message.indexOf('totpToken') !== -1) { document.getElementById('inputTotpToken').value = ''; document.getElementById('inputTotpToken').focus(); document.getElementById('totpError').classList.remove('hide'); return; } else { - throw new Error('Something went wrong'); + document.getElementById('inputPassword').value = ''; + document.getElementById('inputPassword').focus(); + document.getElementById('passwordError').classList.remove('hide'); + return; } } else if (res.status !== 200) { throw new Error('Something went wrong');