Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore JWT authentication for the REST API if the user is already authenticated #22

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `wp-rest-guard` will be documented in this file.

## v1.3.1 - 2024-03-18

- Ignore JWT authentication for the REST API if the user is already authenticated.

## v1.3.0 - 2024-02-27

- Allow the claims to be added to a generated JWT via filter.
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function should_prevent_anonymous_access( WP_REST_Server $server, WP_REST_Reques
return false;
}

if ( class_exists( JWT::class ) ) {
if ( class_exists( JWT::class ) && ! is_user_logged_in() ) {
/**
* Check if the anonymous request requires a JSON Web Token (JWT).
*
Expand Down
Loading