Skip to content

Commit 5317415

Browse files
committed
Bail early if we do not have a stored site id (not connected for email reports) in data request
1 parent c3d0b32 commit 5317415

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

includes/classes/MyDot/Connector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,12 @@ public static function validate_jwt_token_in_request_with_fallback( $request ) {
10611061
$parts = null !== $auth_header ? explode( ' ', $auth_header ) : [];
10621062
if ( ! empty( $auth_header ) ) {
10631063
if ( count( $parts ) === 2 && 'Bearer' === $parts[0] ) {
1064+
// Check if the site is registered currently before attempting validation.
1065+
$site_id = get_option( 'edac_site_id' );
1066+
if ( empty( $site_id ) ) {
1067+
return false;
1068+
}
1069+
10641070
// Use the fallback validator which will refresh key if needed.
10651071
return self::validate_jwt_token_with_fallback( $parts[1] );
10661072
}

0 commit comments

Comments
 (0)