Skip to content

Conversation

sviluppomania
Copy link

The JWT_AUTH_SECRET_KEY as well as JWT_AUTH_CORS_ENABLE can be read from environment variables instead of hardcoding in wp-config.php

The JWT_AUTH_SECRET_KEY as well as JWT_AUTH_CORS_ENABLE can be read from environment variables instead of hardcoding in wp-config.php
@sun
Copy link
Collaborator

sun commented May 18, 2022

You can put the following lines into your wp-config.php to not hardcode them:

define('JWT_AUTH_SECRET_KEY', $_ENV['JWT_AUTH_SECRET_KEY'] ?? '');
define('JWT_AUTH_CORS_ENABLE', $_ENV['JWT_AUTH_CORS_ENABLE'] ?? '');

This has the benefit that you are explicitly documenting which constants are being read from environment variables in your setup.

@sun sun added the documentation Improvements or additions to documentation label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants