Skip to content

Commit

Permalink
Fixing feature
Browse files Browse the repository at this point in the history
  • Loading branch information
srtfisher committed Feb 22, 2024
1 parent b14c422 commit 9c2b6ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
[
Expand Down
2 changes: 2 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ),
];
}

Expand Down

0 comments on commit 9c2b6ee

Please sign in to comment.