Skip to content

Commit

Permalink
CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
srtfisher committed Feb 26, 2024
1 parent acc3b9d commit b2a2be8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
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.2.1 - 2024-02-26

- Allow the claims to be added to added to a generated JWT via filter.

## v1.2.0 - 2024-02-22

- Add support for authenticated users interacting with the REST API.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# REST API Guard

Stable tag: 1.2.0
Stable tag: 1.2.1

Requires at least: 6.0

Expand Down
5 changes: 3 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,10 @@ function generate_jwt( ?int $expiration = null, WP_User|int|null $user = null ):
* The filer cannot modify any existing claims, only add new ones.
*
* @param array<string, mixed> $additional_claims The additional claims to include in the JWT.
* @param WP_User $user The user to include in the JWT.
* @param WP_User|null $user The user to include in the JWT.
* @param array<string, mixed> $payload The payload of the JWT.
*/
$additional_claims = apply_filters( 'rest_api_guard_jwt_additional_claims', [], $user );
$additional_claims = apply_filters( 'rest_api_guard_jwt_additional_claims', [], $user, $payload );

if ( is_array( $additional_claims ) ) {
$payload = array_merge( $additional_claims, $payload );
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=== REST API Guard ===
Stable tag: 1.2.0
Stable tag: 1.2.1
Requires at least: 6.0
Tested up to: 6.3
Requires PHP: 8.0
Expand Down

0 comments on commit b2a2be8

Please sign in to comment.