This commit is contained in:
Bill Burke 2016-01-27 23:04:12 -05:00
parent 5853ae4eff
commit 8a3148017d

View file

@ -185,22 +185,16 @@ public class LoginActionsService {
invalidAction(); invalidAction();
} }
} }
if (isActionActive(actionType)) return false; if (!isActionActive(actionType)) return false;
return true; 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) { public boolean isValidAction(String requiredAction) {
if (!clientCode.isValidAction(requiredAction)) { if (!clientCode.isValidAction(requiredAction)) {
invalidAction(); invalidAction();
return true; return false;
} }
return false; return true;
} }
private void invalidAction() { private void invalidAction() {
@ -216,12 +210,12 @@ public class LoginActionsService {
if (clientCode.getClientSession().getAction().equals(ClientSessionModel.Action.AUTHENTICATE.name())) { if (clientCode.getClientSession().getAction().equals(ClientSessionModel.Action.AUTHENTICATE.name())) {
AuthenticationProcessor.resetFlow(clientCode.getClientSession()); AuthenticationProcessor.resetFlow(clientCode.getClientSession());
response = processAuthentication(null, clientCode.getClientSession(), Messages.LOGIN_TIMEOUT); response = processAuthentication(null, clientCode.getClientSession(), Messages.LOGIN_TIMEOUT);
return true; return false;
} }
response = ErrorPage.error(session, Messages.EXPIRED_CODE); response = ErrorPage.error(session, Messages.EXPIRED_CODE);
return true; return false;
} }
return false; return true;
} }
public boolean verifyCode(String code) { public boolean verifyCode(String code) {
@ -282,8 +276,8 @@ public class LoginActionsService {
if (!verifyCode(code)) { if (!verifyCode(code)) {
return false; return false;
} }
if (isValidAction(ClientSessionModel.Action.REQUIRED_ACTIONS.name())) return false; if (!isValidAction(ClientSessionModel.Action.REQUIRED_ACTIONS.name())) return false;
if (isActionActive(ClientSessionCode.ActionType.USER)) return false; if (!isActionActive(ClientSessionCode.ActionType.USER)) return false;
final ClientSessionModel clientSession = clientCode.getClientSession(); final ClientSessionModel clientSession = clientCode.getClientSession();