Drop unnecessary user_meta keys

isekai
PJ Eby 7 years ago
parent 7879835b49
commit 134d0116b8

@ -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-id-token-claim', $id_token_claim );
update_user_meta( $user->ID, 'openid-connect-generic-last-user-claim', $user_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 // Create the WP session, so we know its token
$expiration = time() + apply_filters( 'auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user->ID, FALSE ); $expiration = time() + apply_filters( 'auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user->ID, FALSE );
$manager = WP_Session_Tokens::get_instance( $user->ID ); $manager = WP_Session_Tokens::get_instance( $user->ID );
@ -725,7 +720,6 @@ class OpenID_Connect_Generic_Client_Wrapper {
$user = get_user_by( 'id', $uid ); $user = get_user_by( 'id', $uid );
// save some meta data about this new user for the future // 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 ); add_user_meta( $user->ID, 'openid-connect-generic-subject-identity', (string) $subject_identity, TRUE );
// log the results // log the results
@ -748,7 +742,6 @@ class OpenID_Connect_Generic_Client_Wrapper {
*/ */
function update_existing_user( $uid, $subject_identity ) { function update_existing_user( $uid, $subject_identity ) {
// add the OpenID Connect meta data // 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 ); add_user_meta( $uid, 'openid-connect-generic-subject-identity', (string) $subject_identity, TRUE );
// allow plugins / themes to take action on user update // allow plugins / themes to take action on user update

@ -28,12 +28,10 @@ Notes
- openid-connect-generic-redirect-user-back - 2 args: $redirect_url, $user. Allows interruption of redirect during login. - openid-connect-generic-redirect-user-back - 2 args: $redirect_url, $user. Allows interruption of redirect during login.
User Meta 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-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-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-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-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 Options
- openid_connect_generic_settings - plugin settings - openid_connect_generic_settings - plugin settings

Loading…
Cancel
Save