From f401b3f53bf8f8a043fb51be4e6ed1be749fbb4a Mon Sep 17 00:00:00 2001 From: Jonathan Daggerhart Date: Wed, 22 Apr 2020 08:30:26 -0400 Subject: [PATCH] moving openid-connect-generic-alter-user-claim to top of method --- includes/openid-connect-generic-client-wrapper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/openid-connect-generic-client-wrapper.php b/includes/openid-connect-generic-client-wrapper.php index 96769cc..b44fb66 100644 --- a/includes/openid-connect-generic-client-wrapper.php +++ b/includes/openid-connect-generic-client-wrapper.php @@ -633,6 +633,8 @@ class OpenID_Connect_Generic_Client_Wrapper { * @return \WP_Error | \WP_User */ function create_new_user( $subject_identity, $user_claim ) { + $user_claim = apply_filters( 'openid-connect-generic-alter-user-claim', $user_claim ); + // default username & email to the subject identity $username = $subject_identity; $email = $subject_identity; @@ -732,7 +734,6 @@ class OpenID_Connect_Generic_Client_Wrapper { return new WP_Error( 'cannot-authorize', __( 'Can not authorize.' ), $create_user ); } - $user_claim = apply_filters( 'openid-connect-generic-alter-user-claim', $user_claim ); $user_data = array( 'user_login' => $username, 'user_pass' => wp_generate_password( 32, true, true ),