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() {
26
26
*/
27
27
function render_profile_section ( WP_User $ user ) {
28
28
$ tokens = Access_Token::get_for_user ( $ user );
29
+ $ tokens = array_filter ( $ tokens , function ( Access_Token $ token ) {
30
+ return (bool ) $ token ->get_client ();
31
+ });
32
+
29
33
?>
30
34
<h2><?php _e ( 'Authorized Applications ' , 'oauth2 ' ) ?> </h2>
31
35
<?php if ( ! empty ( $ tokens ) ) : ?>
Original file line number Diff line number Diff line change @@ -117,9 +117,10 @@ function attempt_authentication( $user = null ) {
117
117
// Attempt to find the token.
118
118
$ is_querying_token = true ;
119
119
$ token = Tokens \get_by_id ( $ token_value );
120
+ $ client = $ token ->get_client ();
120
121
$ is_querying_token = false ;
121
122
122
- if ( empty ( $ token ) ) {
123
+ if ( empty ( $ token ) || empty ( $ client ) ) {
123
124
$ oauth2_error = create_invalid_token_error ( $ token_value );
124
125
return $ user ;
125
126
}
You can’t perform that action at this time.
0 commit comments