Update: 2026-07-22 18:11:54

This commit is contained in:
Hamza-Ayed
2026-07-22 18:11:54 +03:00
parent 771b436c69
commit f62716b510
3 changed files with 6 additions and 132 deletions
+5 -2
View File
@@ -44,9 +44,12 @@ $INTERNAL_KEY = trim(file_get_contents('/home/location/.internal_socket_key'));
// });
function authenticateJWT()
{
$secretKey = trim(file_get_contents('/home/location/.secret_key')); // Access secret key (ensure it's set in .env)
$secretKeyFile = file_exists(__DIR__ . '/../../loction-keys/.secret_key')
? __DIR__ . '/../../loction-keys/.secret_key'
: (file_exists('/keys/.secret_key') ? '/keys/.secret_key' : '/home/location/.secret_key');
$secretKey = trim((string) @file_get_contents($secretKeyFile)); // Access secret key (ensure it's set in .env)
if (!$secretKey) {
error_log("SECRET_KEY not set in environment variables.");
error_log("SECRET_KEY not set in environment variables. Path checked: $secretKeyFile");
http_response_code(500); // Internal Server Error
echo json_encode(['error' => 'Internal server configuration error.']);
exit;