From 134d0116b89af4d8691f98edd303938ac7073207 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Sat, 16 Dec 2017 13:24:52 -0500 Subject: [PATCH] Drop unnecessary user_meta keys --- includes/openid-connect-generic-client-wrapper.php | 7 ------- openid-connect-generic.php | 2 -- 2 files changed, 9 deletions(-) diff --git a/includes/openid-connect-generic-client-wrapper.php b/includes/openid-connect-generic-client-wrapper.php index 135b26c..072441b 100644 --- a/includes/openid-connect-generic-client-wrapper.php +++ b/includes/openid-connect-generic-client-wrapper.php @@ -416,11 +416,6 @@ class OpenID_Connect_Generic_Client_Wrapper { update_user_meta( $user->ID, 'openid-connect-generic-last-id-token-claim', $id_token_claim ); update_user_meta( $user->ID, 'openid-connect-generic-last-user-claim', $user_claim ); - // if we're allowing users to use WordPress and OpenID Connect, we need to set this to true at every login - if( $this->settings->link_existing_users ) { - update_user_meta( $user->ID, 'openid-connect-generic-user', TRUE ); - } - // Create the WP session, so we know its token $expiration = time() + apply_filters( 'auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user->ID, FALSE ); $manager = WP_Session_Tokens::get_instance( $user->ID ); @@ -725,7 +720,6 @@ class OpenID_Connect_Generic_Client_Wrapper { $user = get_user_by( 'id', $uid ); // save some meta data about this new user for the future - add_user_meta( $user->ID, 'openid-connect-generic-user', TRUE, TRUE ); add_user_meta( $user->ID, 'openid-connect-generic-subject-identity', (string) $subject_identity, TRUE ); // log the results @@ -748,7 +742,6 @@ class OpenID_Connect_Generic_Client_Wrapper { */ function update_existing_user( $uid, $subject_identity ) { // add the OpenID Connect meta data - add_user_meta( $uid, 'openid-connect-generic-user', TRUE, TRUE ); add_user_meta( $uid, 'openid-connect-generic-subject-identity', (string) $subject_identity, TRUE ); // allow plugins / themes to take action on user update diff --git a/openid-connect-generic.php b/openid-connect-generic.php index 01dd127..c9747d8 100644 --- a/openid-connect-generic.php +++ b/openid-connect-generic.php @@ -28,12 +28,10 @@ Notes - openid-connect-generic-redirect-user-back - 2 args: $redirect_url, $user. Allows interruption of redirect during login. User Meta - - openid-connect-generic-user - (bool) if the user was created by this plugin - openid-connect-generic-subject-identity - the identity of the user provided by the idp - openid-connect-generic-last-id-token-claim - the user's most recent id_token claim, decoded - openid-connect-generic-last-user-claim - the user's most recent user_claim - openid-connect-generic-last-token-response - the user's most recent token response - - openid-connect-generic-refresh-cookie-key - encryption key used to secure refresh token info in cookie Options - openid_connect_generic_settings - plugin settings