diff --git a/src/main/java/com/auth0/RandomStorage.java b/src/main/java/com/auth0/RandomStorage.java index f9510bb..66659a0 100644 --- a/src/main/java/com/auth0/RandomStorage.java +++ b/src/main/java/com/auth0/RandomStorage.java @@ -15,11 +15,7 @@ class RandomStorage extends SessionUtils { */ static boolean checkSessionState(HttpServletRequest req, String state) { String currentState = (String) remove(req, StorageUtils.STATE_KEY); - if (currentState == null) { - return state == null; - } else { - return currentState.equals(state); - } + return (currentState == null && state == null) || currentState != null && currentState.equals(state); } /**