<?php
namespace OxygenApp\Common\Guards;

if ( ! defined( 'ABSPATH' ) ) exit;

use WP_REST_Request;
use OxygenApp\Utils\UserUtil;
use OxygenApp\Models\User;

class GetPlaylistsGuard extends BaseGuard implements GuardInterface {

    public static function check(WP_REST_Request $request): array {

        if (!UserUtil::isLoggedIn()) {
            return self::getFailedResponse(esc_html__('You must be logged in to access this route.', 'oxyleaf-app-working-and-relaxing-app'), 403);
        }
        return self::getSuccessResponse();
    }
}