Skip to content

Commit

Permalink
Merge pull request #97 from kellenmace/feature/expose-auth-token-in-r…
Browse files Browse the repository at this point in the history
…esponse-headers

Expose auth token in response headers
  • Loading branch information
jasonbahl authored Oct 24, 2024
2 parents 9e96a5f + 8645d32 commit 5d20262
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ManageTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,15 +364,15 @@ public static function add_auth_headers_to_rest_response( $response ) {
}

/**
* Expose the X-JWT-Refresh tokens in the response headers. This allows
* folks to grab new refresh tokens from authenticated requests for subsequent use.
* Expose the X-JWT-Auth and X-JWT-Refresh tokens in the response headers. This
* allows folks to grab new tokens from authenticated requests for subsequent use.
*
* @param array $headers The existing response headers.
*
* @return array
* @return array Response headers, with X-JWT-Auth and X-JWT-Refresh added.
*/
public static function add_auth_headers_to_response( array $headers ) {
$headers['Access-Control-Expose-Headers'] = 'X-JWT-Refresh';
$headers['Access-Control-Expose-Headers'] = 'X-JWT-Auth,X-JWT-Refresh';

return $headers;
}
Expand Down

0 comments on commit 5d20262

Please sign in to comment.