Skip to content

Commit

Permalink
Fixed parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanoord committed Apr 1, 2023
1 parent c0dbb51 commit bb9b5b1
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions plugins/bcc-login/bcc-login.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,25 @@ function redirect_login() {

$action = isset( $_GET['action'] ) ? $_GET['action'] : '';

if (
$pagenow != 'wp-login.php' ||
isset( $_GET['loggedout'] ) ||
isset( $_POST['wp-submit'] ) ||
isset( $_GET['login-error'] ) ||
in_array( $action, array( 'logout', 'lostpassword', 'rp', 'resetpass', 'register' ) )
if ($this->should_auto_login() ||
(
$pagenow == 'wp-login.php' &&
!isset( $_GET['loggedout'] ) &&
!isset( $_POST['wp-submit'] ) &&
!isset( $_GET['login-error'] ) &&
!in_array( $action, array( 'logout', 'lostpassword', 'rp', 'resetpass', 'register' ) )
)
) {
return;
$this->_client->start_login();
}
}


function should_auto_login() {

// Don't log in user if they are already logged in
if (is_user_logged_in() && $this->_client->is_session_valid()) {
return false;
}

$this->_client->start_login();
Expand Down

0 comments on commit bb9b5b1

Please sign in to comment.