Skip to content

Commit

Permalink
Force boolean type when checking PKCE setting
Browse files Browse the repository at this point in the history
  • Loading branch information
petitphp committed Jul 11, 2022
1 parent 66e1083 commit 8c2fcc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/openid-connect-generic-client-wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static function register( OpenID_Connect_Generic_Client $client, OpenID_C
}

// Modify authentication-token request to include PKCE code verifier.
if ( $settings->enable_pkce ) {
if ( true === (bool) $settings->enable_pkce ) {
add_filter( 'openid-connect-generic-alter-request', array( $client_wrapper, 'alter_authentication_token_request' ), 15, 3 );
}

Expand Down Expand Up @@ -237,7 +237,7 @@ public function get_authentication_url( $atts = array() ) {
$url_format .= '&acr_values=%7$s';
}

if ( $this->settings->enable_pkce ) {
if ( true === (bool) $this->settings->enable_pkce ) {
$pkce_data = $this->pkce_code_generator();
if ( false !== $pkce_data ) {
$url_format .= '&code_challenge=%8$s&code_challenge_method=%9$s';
Expand Down

0 comments on commit 8c2fcc8

Please sign in to comment.