Skip to content

Commit 1b43be0

Browse files
haniczsmolnar82
authored andcommitted
KNOX-3371: Fix broken error message on login page (#1290)
(cherry picked from commit 39a168a)
1 parent 13e71dd commit 1b43be0

3 files changed

Lines changed: 30 additions & 6 deletions

File tree

gateway-applications/src/main/resources/applications/knoxauth/app/js/knoxauth.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,15 @@ var login = function() {
121121
}
122122
redirect(redirectUrl);
123123
} else {
124-
$('#errorBox').show();
125-
$('#signInLoading').css('visibility', 'hidden');
126-
$('#signIn').removeAttr('disabled');
127124
if (request.status == 401) {
128125
$('#errorBox .errorMsg').text("The username or password you entered is incorrect.");
129126
} else {
130127
$('#errorBox .errorMsg').text("Response from " + request.responseURL + " - " + request.status + ": " + request.statusText);
131128
}
129+
$('#errorBox').show();
130+
$('#signInLoading').css('visibility', 'hidden');
131+
$('#signIn').removeAttr('disabled');
132+
$(window).trigger('resize');
132133
}
133134
}
134135
};

gateway-applications/src/main/resources/applications/knoxauth/app/login.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@
102102
<label><i class="bi bi-lock"></i> Password:</label>
103103
<input type="password" name="password" id="password" tabindex="2" autocomplete="off" onkeypress=keypressed(event)>
104104
</div>
105-
<span id="errorBox" class="help-inline" style="color:white;display:none;"><span class="errorMsg"></span>
106-
<i class="bi bi-exclamation-triangle" style="color:#ae2817;"></i>
107-
</span>
105+
<div id="errorBox" style="display:none;" role="alert">
106+
<i class="bi bi-exclamation-triangle" aria-hidden="true"></i>
107+
<span class="errorMsg"></span>
108+
</div>
108109
<button type="button" class="btn btn-primary w-100" id="signIn" tabindex="4" onkeypress="keypressed(event)" onclick="login();" style="position: relative; text-align: center;">
109110
<span>Sign In</span>
110111
<i id="signInLoading" class="bi bi-arrow-repeat icon-sign-in"></i>

gateway-applications/src/main/resources/applications/knoxauth/app/styles/knox.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,6 +1732,28 @@ body.login {
17321732
box-shadow: none !important;
17331733
outline: none !important;
17341734
}
1735+
.login #errorBox {
1736+
margin-top: 12px;
1737+
padding: 10px 12px;
1738+
background-color: rgba(174, 40, 23, 0.15);
1739+
border: 1px solid #ae2817;
1740+
border-radius: 3px;
1741+
color: #fff;
1742+
font-size: 13px;
1743+
line-height: 1.4;
1744+
word-wrap: break-word;
1745+
overflow-wrap: break-word;
1746+
box-sizing: border-box;
1747+
width: 100%;
1748+
}
1749+
.login #errorBox i {
1750+
color: #ae2817;
1751+
margin-right: 8px;
1752+
vertical-align: text-top;
1753+
}
1754+
.login #errorBox .errorMsg {
1755+
display: inline;
1756+
}
17351757
.label-yellow{
17361758
background-color: #f3a139;
17371759
}

0 commit comments

Comments
 (0)