Skip to content

Commit

Permalink
Login - flash statusText instead of "Incorrect username or password"
Browse files Browse the repository at this point in the history
  • Loading branch information
himdel committed Sep 5, 2018
1 parent 5caa591 commit 0aa9f5b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/assets/javascripts/miq_application.js
Expand Up @@ -727,9 +727,14 @@ function miqAjaxAuth(url) {

// TODO vanillaJsAPI.autorenew is called on (non-login) page load - when?
})
.then(null, function() {
.then(null, function(err) {
var message = __('Incorrect username or password');
if (err && err.status && err.status !== 200 && err.statusText) {
message = __('Login failed:') + ' ' + err.statusText;
}

clearFlash();
add_flash(__('Incorrect username or password'), 'error', { id: 'auth_failed' });
add_flash(message, 'error', { id: 'auth_failed' });

miqClearLoginFields();
miqEnableLoginFields(true);
Expand Down

0 comments on commit 0aa9f5b

Please sign in to comment.