Tmeister / wp-api-jwt-auth

A simple plugin to add JSON Web Token (JWT) Authentication to WP REST API
GNU General Public License v2.0
549 stars 159 forks source link

Set defines through environment variables #244

Open idleberg opened 2 years ago

idleberg commented 2 years ago

Most of the times, I'm using WordPress as provided by the official Docker image. In all other cases, I prefer Roots Bedrock. Both have in common, that they're configured by environment variables. That's why I was wondering if you are open to supporting them to configure your plugin.

Example

defined('JWT_AUTH_SECRET_KEY') ? JWT_AUTH_SECRET_KEY : $_ENV["JWT_AUTH_SECRET_KEY"] ?? false;
defined('JWT_AUTH_CORS_ENABLE') ? JWT_AUTH_CORS_ENABLE : $_ENV["JWT_AUTH_CORS_ENABLE"] ?? false;
Tmeister commented 1 year ago

Hi,

I think just a handful of people use that configuration but if you created a PR I can consider adding it.

Best,