From 8a3148017ddf6082b4ed632d20c36c7961506dff Mon Sep 17 00:00:00 2001 From: Bill Burke Date: Wed, 27 Jan 2016 23:04:12 -0500 Subject: [PATCH] fix --- .../resources/LoginActionsService.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/services/src/main/java/org/keycloak/services/resources/LoginActionsService.java b/services/src/main/java/org/keycloak/services/resources/LoginActionsService.java index bf654f6286..6a5054599b 100755 --- a/services/src/main/java/org/keycloak/services/resources/LoginActionsService.java +++ b/services/src/main/java/org/keycloak/services/resources/LoginActionsService.java @@ -185,22 +185,16 @@ public class LoginActionsService { invalidAction(); } } - if (isActionActive(actionType)) return false; + if (!isActionActive(actionType)) return false; return true; } - public boolean verifyAction(String requiredAction, ClientSessionCode.ActionType actionType) { - if (isValidAction(requiredAction)) return false; - if (isActionActive(actionType)) return false; - return true; - } - public boolean isValidAction(String requiredAction) { if (!clientCode.isValidAction(requiredAction)) { invalidAction(); - return true; + return false; } - return false; + return true; } private void invalidAction() { @@ -216,12 +210,12 @@ public class LoginActionsService { if (clientCode.getClientSession().getAction().equals(ClientSessionModel.Action.AUTHENTICATE.name())) { AuthenticationProcessor.resetFlow(clientCode.getClientSession()); response = processAuthentication(null, clientCode.getClientSession(), Messages.LOGIN_TIMEOUT); - return true; + return false; } response = ErrorPage.error(session, Messages.EXPIRED_CODE); - return true; + return false; } - return false; + return true; } public boolean verifyCode(String code) { @@ -282,8 +276,8 @@ public class LoginActionsService { if (!verifyCode(code)) { return false; } - if (isValidAction(ClientSessionModel.Action.REQUIRED_ACTIONS.name())) return false; - if (isActionActive(ClientSessionCode.ActionType.USER)) return false; + if (!isValidAction(ClientSessionModel.Action.REQUIRED_ACTIONS.name())) return false; + if (!isActionActive(ClientSessionCode.ActionType.USER)) return false; final ClientSessionModel clientSession = clientCode.getClientSession();