302 Redirect loop for locked users (with solution code)
-
When a user is locked out, i get a 302 redirect loop to the frontpage.
I have isolated the problem to be in class-itsec-lockout.php in the execute_lock method.
This code assumes that the wp_get_current_user function does not return an object for a logged out user. But it does! It is just an empty user-object with ID = 0
$current_user = wp_get_current_user(); if ( is_object( $current_user ) && isset( $current_user->ID )) { wp_logout(); }
Proposed solution (The code is almost directly taken from the example on wp_get_current_user documentation page:
$current_user = wp_get_current_user(); if ( $current_user->ID !== 0) { wp_logout(); }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘302 Redirect loop for locked users (with solution code)’ is closed to new replies.