KEYCLOAK-107 fix for login form error feedback issues
This commit is contained in:
parent
26156df8f8
commit
71f3d00e31
3 changed files with 13 additions and 9 deletions
|
@ -31,18 +31,16 @@
|
|||
<div class="form-area ${(realm.social)?string('social','')} clearfix">
|
||||
<div class="section app-form">
|
||||
<h3>Application login area</h3>
|
||||
<#if error?has_content>
|
||||
<div class="feedback error bottom-left show">
|
||||
<p>
|
||||
<strong id="loginError">${rb.getString(error.summary)}</strong><br/>${rb.getString('emailErrorInfo')}
|
||||
</p>
|
||||
</div>
|
||||
</#if>
|
||||
<#nested "form">
|
||||
</div>
|
||||
|
||||
<#if error?has_content>
|
||||
<div class="
|
||||
error bottom-left show">
|
||||
<p>
|
||||
<strong id="loginError">${rb.getString(error.summary)}</strong>
|
||||
</p>
|
||||
</div>
|
||||
</#if>
|
||||
|
||||
<#if social.displaySocialProviders>
|
||||
<div class="section social-login"> <span>or</span>
|
||||
<h3>Social login area</h3>
|
||||
|
|
|
@ -53,4 +53,5 @@ emailForgotHeader=Forgot Your Password?
|
|||
emailUpdateHeader=Update password
|
||||
emailSent=You should receive an email shortly with further instructions.
|
||||
emailError=Invalid username or email.
|
||||
emailErrorInfo=Please, fill in the fields again.
|
||||
emailInstruction=Enter your username and email address and we will send you instructions on how to create a new password.
|
|
@ -192,6 +192,11 @@ public class TokenService {
|
|||
String username = formData.getFirst("username");
|
||||
UserModel user = realm.getUser(username);
|
||||
|
||||
if (user == null){
|
||||
return Flows.forms(realm, request, uriInfo).setError(Messages.INVALID_USER).setFormData(formData)
|
||||
.forwardToLogin();
|
||||
}
|
||||
|
||||
isTotpConfigurationRequired(user);
|
||||
isEmailVerificationRequired(user);
|
||||
|
||||
|
|
Loading…
Reference in a new issue