From eef307a7bdb141b671058e2214e68d0fd27866f1 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 31 Dec 2020 09:24:02 +0900 Subject: fix --- snippets/oidc-woocommerce.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/snippets/oidc-woocommerce.php b/snippets/oidc-woocommerce.php index 2731728..bdb4fdc 100644 --- a/snippets/oidc-woocommerce.php +++ b/snippets/oidc-woocommerce.php @@ -66,24 +66,24 @@ add_filter( * @return True if a reference was found */ function get_claim( $claimname, $userinfo, &$claimvalue ) { - if ( ! isset( $token_response ) ) { + if ( ! isset( $userinfo ) ) { return False; } /** * If we find a simple claim, return it. */ - if ( array_keys_exists( $claimname, $token_response ) ) { - $claimvalue = $token_response[$claimname]; + if ( array_keys_exists( $claimname, $userinfo ) ) { + $claimvalue = $userinfo[$claimname]; return True; } /** * If there are not aggregated claims, it is over. */ - if ( ! array_key_exists( '_claim_names', $token_response ) || - ! array_key_exists( '_claim_sources', $token_response ) ) { + if ( ! array_key_exists( '_claim_names', $userinfo ) || + ! array_key_exists( '_claim_sources', $userinfo ) ) { return False; } - $claim_src_ptr = $token_response['_claim_names']; + $claim_src_ptr = $userinfo['_claim_names']; if ( ! isset( $claim_src_ptr ) ) { return False; } @@ -95,7 +95,7 @@ function get_claim( $claimname, $userinfo, &$claimvalue ) { } $src = $claim_src_ptr[$claimname]; //Reference found, but no corresponding JWT. This is a malformed userinfo - if ( ! array_key_exists( $src, $token_response['_claim_sources']) ) { + if ( ! array_key_exists( $src, $userinfo['_claim_sources']) ) { return False; } //Source claim is not a JWT. Abort. -- cgit v1.2.3