Merge pull request #2644 from patriot1burke/master

KEYCLOAK-2740
This commit is contained in:
Bill Burke 2016-04-15 17:42:26 -04:00
commit 8830f87a76
9 changed files with 23 additions and 6 deletions

View file

@ -195,4 +195,5 @@ public class Messages {
public static final String FAILED_LOGOUT = "failedLogout";
public static final String CONSENT_DENIED="consentDenied";
public static final String ALREADY_LOGGED_IN="alreadyLoggedIn";
}

View file

@ -173,11 +173,14 @@ public class LoginActionsService {
return false;
}
if (!clientCode.isValidAction(requiredAction)) {
if (ClientSessionModel.Action.REQUIRED_ACTIONS.name().equals(clientCode.getClientSession().getAction())) {
ClientSessionModel clientSession = clientCode.getClientSession();
if (ClientSessionModel.Action.REQUIRED_ACTIONS.name().equals(clientSession.getAction())) {
response = redirectToRequiredActions(code);
return false;
} else {
invalidAction();
} else if (clientSession.getUserSession() != null && clientSession.getUserSession().getState() == UserSessionModel.State.LOGGED_IN) {
response = session.getProvider(LoginFormsProvider.class)
.setSuccess(Messages.ALREADY_LOGGED_IN)
.createInfoPage();
return false;
}
}
@ -185,7 +188,7 @@ public class LoginActionsService {
return true;
}
public boolean isValidAction(String requiredAction) {
private boolean isValidAction(String requiredAction) {
if (!clientCode.isValidAction(requiredAction)) {
invalidAction();
return false;
@ -199,7 +202,7 @@ public class LoginActionsService {
response = ErrorPage.error(session, Messages.INVALID_CODE);
}
public boolean isActionActive(ClientSessionCode.ActionType actionType) {
private boolean isActionActive(ClientSessionCode.ActionType actionType) {
if (!clientCode.isActionActive(actionType)) {
event.client(clientCode.getClientSession().getClient());
event.clone().error(Errors.EXPIRED_CODE);

View file

@ -196,3 +196,5 @@ backToApplication=« Torna a l''aplicaci\u00F3
missingParameterMessage=Par\u00E0metres que falten: {0}
clientNotFoundMessage=Client no trobat
invalidParameterMessage=Par\u00E0metre no v\u00E0lid: {0}
alreadyLoggedIn=You are already logged in.

View file

@ -191,4 +191,5 @@ invalidParameterMessage=Invalid parameter\: {0}
missingParameterMessage=Missing parameter\: {0}
clientNotFoundMessage=Client not found.
emailVerifiedMessage=Ihr E-Mail Adresse wurde erfolgreich verifiziert.
emailVerifiedMessage=Ihr E-Mail Adresse wurde erfolgreich verifiziert.
alreadyLoggedIn=You are already logged in.

View file

@ -221,3 +221,5 @@ backToApplication=« Back to Application
missingParameterMessage=Missing parameters\: {0}
clientNotFoundMessage=Client not found.
invalidParameterMessage=Invalid parameter\: {0}
alreadyLoggedIn=You are already logged in.

View file

@ -196,3 +196,5 @@ backToApplication=« Volver a la aplicaci\u00F3n
missingParameterMessage=Par\u00E1metros que faltan: {0}
clientNotFoundMessage=Cliente no encontrado
invalidParameterMessage=Par\u00E1metro no v\u00E1lido: {0}
alreadyLoggedIn=You are already logged in.

View file

@ -210,3 +210,5 @@ backToApplication=« Revenir \u00e0 l''application
missingParameterMessage=Param\u00e8tres manquants\: {0}
clientNotFoundMessage=Client inconnu.
invalidParameterMessage=Param\u00e8tre invalide\: {0}
alreadyLoggedIn=You are already logged in.

View file

@ -189,3 +189,5 @@ backToApplication=« Torna all''Applicazione
missingParameterMessage=Parametri Mancanti\: {0}
clientNotFoundMessage=Client non trovato.
invalidParameterMessage=Parametro non valido\: {0}
alreadyLoggedIn=You are already logged in.

View file

@ -210,3 +210,5 @@ backToApplication=« Voltar para o aplicativo
missingParameterMessage=Par\u00E2metros que faltam\: {0}
clientNotFoundMessage=Cliente n\u00E3o encontrado.
invalidParameterMessage=Par\u00E2mentro inv\u00E1lido\: {0}
alreadyLoggedIn=You are already logged in.