Fall back to \$_SERVER for LinkedIn env vars to support PHP-FPM
Apache SetEnv doesn't reach PHP-FPM processes via getenv(), but the values are still available in \$_SERVER. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f6e768c246
commit
e8e4476a58
2 changed files with 3 additions and 3 deletions
|
|
@ -8,7 +8,7 @@ $stmt = $db->prepare('SELECT * FROM projects WHERE id = ? AND is_active = 1');
|
|||
$stmt->execute([$pid]);
|
||||
if (!$stmt->fetch()) { http_response_code(404); echo json_encode(['error' => 'Project not found']); exit; }
|
||||
|
||||
$client_id = getenv('LINKEDIN_CLIENT_ID');
|
||||
$client_id = getenv('LINKEDIN_CLIENT_ID') ?: ($_SERVER['LINKEDIN_CLIENT_ID'] ?? null);
|
||||
if (!$client_id) { echo json_encode(['error' => 'LINKEDIN_CLIENT_ID not set in server environment']); exit; }
|
||||
|
||||
$state = bin2hex(random_bytes(16));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue