Skip to content

Commit

Permalink
Fix url for already authenticated users.
Browse files Browse the repository at this point in the history
  • Loading branch information
kuasha420 committed Oct 19, 2021
1 parent eda6388 commit d87082f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions includes/Core/Authentication/Authentication.php
Expand Up @@ -1077,14 +1077,22 @@ private function get_authentication_oauth_error_notice() {
return '';
}

$message = $auth_client->get_error_message( $error_code );
$access_code = $this->user_options->get( OAuth_Client::OPTION_PROXY_ACCESS_CODE );
$message = $auth_client->get_error_message( $error_code );

if ( $this->credentials->using_proxy() ) {
if ( $this->is_authenticated() ) {

$setup_url = $this->get_connect_url();

} elseif ( $this->credentials->using_proxy() ) {

$access_code = $this->user_options->get( OAuth_Client::OPTION_PROXY_ACCESS_CODE );
$setup_url = $auth_client->get_proxy_setup_url( $access_code );
$this->user_options->delete( OAuth_Client::OPTION_PROXY_ACCESS_CODE );

} else {

$setup_url = $this->context->admin_url( 'splash' );

}

if ( 'access_denied' === $error_code ) {
Expand Down

0 comments on commit d87082f

Please sign in to comment.