From 9c2b6eec44d26bd74f82a0c50cea6fcc0e710139 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Thu, 22 Feb 2024 17:02:37 -0500 Subject: [PATCH] Fixing feature --- plugin.php | 9 +++++---- settings.php | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugin.php b/plugin.php index e3e4448..7434adc 100644 --- a/plugin.php +++ b/plugin.php @@ -115,14 +115,15 @@ function should_prevent_anonymous_access( WP_REST_Server $server, WP_REST_Reques * Filter the authorization error message. * * @param string $message The error message being returned. - * @param string $error_message The error message from the exception. * @param \Throwable $error The error that occurred. */ apply_filters( 'rest_api_guard_invalid_jwt_message', - /* translators: %s: The error message. */ - __( 'Error authentication with token: %s', 'rest-api-guard' ), - $error->getMessage(), + sprintf( + /* translators: %s: The error message. */ + __( 'Error authentication with token: %s', 'rest-api-guard' ), + $error->getMessage(), + ), $error, ), [ diff --git a/settings.php b/settings.php index f372781..3937c9b 100644 --- a/settings.php +++ b/settings.php @@ -234,6 +234,8 @@ function sanitize_settings( $input ) { 'allow_user_access' => ! empty( $input['allow_user_access'] ), 'anonymous_requests_allowlist' => ! empty( $input['anonymous_requests_allowlist'] ) ? sanitize_textarea_field( $input['anonymous_requests_allowlist'] ) : '', 'anonymous_requests_denylist' => ! empty( $input['anonymous_requests_denylist'] ) ? sanitize_textarea_field( $input['anonymous_requests_denylist'] ) : '', + 'authentication_jwt' => ! empty( $input['authentication_jwt'] ), + 'user_authentication_jwt' => ! empty( $input['user_authentication_jwt'] ), ]; }