oidc: fix error message with correct username but bad password
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user