<?php

// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound -- APD is the established namespace shared with the Pro add-on and retained for backward compatibility.
namespace APD\Api\Middleware;

defined('ABSPATH') || exit;

class NonceGuard
{
    public static function verify(\WP_REST_Request $request) : bool
    {
        $nonce = $request->get_header('x_wp_nonce');
        return wp_verify_nonce($nonce, 'wp_rest') !== false;
    }
}
