diff --git a/jwt-auth.php b/jwt-auth.php index ae6d9e6..ecc933f 100644 --- a/jwt-auth.php +++ b/jwt-auth.php @@ -29,4 +29,14 @@ require __DIR__ . '/class-setup.php'; require __DIR__ . '/class-devices.php'; +// Register JWT constants from environment variables +$jwt_env_vars = array( + 'JWT_AUTH_SECRET_KEY' => '', + 'JWT_AUTH_CORS_ENABLE' => false +); + +foreach($jwt_env_vars as $key => $default) { + defined($key) or define($key, getenv($key) ?? $default); +} + JWTAuth\Setup::getInstance();