File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ function bootstrap() {
2626 */
2727function render_profile_section ( WP_User $ user ) {
2828 $ tokens = Access_Token::get_for_user ( $ user );
29+ $ tokens = array_filter ( $ tokens , function ( Access_Token $ token ) {
30+ return (bool ) $ token ->get_client ();
31+ });
32+
2933 ?>
3034 <h2><?php _e ( 'Authorized Applications ' , 'oauth2 ' ) ?> </h2>
3135 <?php if ( ! empty ( $ tokens ) ) : ?>
Original file line number Diff line number Diff line change @@ -117,9 +117,10 @@ function attempt_authentication( $user = null ) {
117117 // Attempt to find the token.
118118 $ is_querying_token = true ;
119119 $ token = Tokens \get_by_id ( $ token_value );
120+ $ client = $ token ->get_client ();
120121 $ is_querying_token = false ;
121122
122- if ( empty ( $ token ) ) {
123+ if ( empty ( $ token ) || empty ( $ client ) ) {
123124 $ oauth2_error = create_invalid_token_error ( $ token_value );
124125 return $ user ;
125126 }
You can’t perform that action at this time.
0 commit comments