KEYCLOAK-2435

Feedback on login screen not showing correctly
This commit is contained in:
Stian Thorgersen 2016-02-03 13:41:31 +01:00
parent adfc93cfc9
commit 2974034974
6 changed files with 13 additions and 3 deletions

View file

@ -109,6 +109,8 @@ public interface LoginFormsProvider extends Provider {
public LoginFormsProvider setSuccess(String message, Object ... parameters);
public LoginFormsProvider setInfo(String message, Object ... parameters);
public LoginFormsProvider setUser(UserModel user);
public LoginFormsProvider setResponseHeader(String headerName, String headerValue);

View file

@ -67,6 +67,6 @@ public class IdpUsernamePasswordForm extends UsernamePasswordForm {
return context.form()
.setFormData(formData)
.setAttribute(LoginFormsProvider.USERNAME_EDIT_DISABLED, true)
.setSuccess(Messages.FEDERATED_IDENTITY_CONFIRM_REAUTHENTICATE_MESSAGE, existingUser.getUsername(), serializedCtx.getIdentityProviderId());
.setInfo(Messages.FEDERATED_IDENTITY_CONFIRM_REAUTHENTICATE_MESSAGE, existingUser.getUsername(), serializedCtx.getIdentityProviderId());
}
}

View file

@ -569,6 +569,12 @@ public class FreeMarkerLoginFormsProvider implements LoginFormsProvider {
return this;
}
@Override
public FreeMarkerLoginFormsProvider setInfo(String message, Object... parameters) {
setMessage(MessageType.INFO, message, parameters);
return this;
}
@Override
public FreeMarkerLoginFormsProvider setUser(UserModel user) {
this.user = user;

View file

@ -23,6 +23,6 @@ package org.keycloak.theme.beans;
*/
public enum MessageType {
SUCCESS, WARNING, ERROR
SUCCESS, WARNING, INFO, ERROR
}

View file

@ -62,6 +62,7 @@
<#if message.type = 'success'><span class="${properties.kcFeedbackSuccessIcon}"></span></#if>
<#if message.type = 'warning'><span class="${properties.kcFeedbackWarningIcon}"></span></#if>
<#if message.type = 'error'><span class="${properties.kcFeedbackErrorIcon}"></span></#if>
<#if message.type = 'info'><span class="${properties.kcFeedbackInfoIcon}"></span></#if>
<span class="kc-feedback-text">${message.summary}</span>
</div>
</div>

View file

@ -20,7 +20,8 @@ kcFormAreaClass=col-xs-12 col-sm-8 col-md-8 col-lg-7 login
kcFeedbackErrorIcon=pficon pficon-error-circle-o
kcFeedbackWarningIcon=pficon pficon-warning-triangle-o
kcFeedbackSuccessIcon=alert alert-success
kcFeedbackSuccessIcon=pficon pficon-ok
kcFeedbackInfoIcon=pficon pficon-info
kcFormClass=form-horizontal