new filetag endpoint and config.php update

This commit is contained in:
Ryan
2025-04-10 10:33:13 -04:00
committed by GitHub
parent 894cc938a5
commit 4360f2830a
3 changed files with 49 additions and 4 deletions

View File

@@ -48,9 +48,12 @@ function decryptData($encryptedData, $encryptionKey)
}
// Load encryption key from environment (override in production).
$encryptionKey = getenv('PERSISTENT_TOKENS_KEY') ?: 'default_please_change_this_key';
if (!$encryptionKey) {
die('Encryption key for persistent tokens is not set.');
$envKey = getenv('PERSISTENT_TOKENS_KEY');
if ($envKey === false || $envKey === '') {
$encryptionKey = 'default_please_change_this_key';
error_log('WARNING: Using default encryption key. Please set PERSISTENT_TOKENS_KEY in your environment.');
} else {
$encryptionKey = $envKey;
}
function loadUserPermissions($username)