Fix : Forward REMOTE_USER

In remote_user_guard auth mode, fireflyiii wasn't receiving REMOTE_USER
This issue occurs with docker image and standalone (when using apache)
This commit is contained in:
Julien Cassagne 2020-10-31 18:46:01 -04:00
parent 433397cb3d
commit 700db14de2
No known key found for this signature in database
GPG Key ID: BDD9E65E8172FDD2

View File

@ -67,9 +67,9 @@ class RemoteUserGuard implements Guard
return; return;
} }
// Get the user identifier from $_SERVER // Get the user identifier from $_SERVER or apache filtered headers
$header = config('auth.guard_header', 'REMOTE_USER'); $header = config('auth.guard_header', 'REMOTE_USER');
$userID = request()->server($header) ?? null; $userID = request()->server($header) ?? apache_request_headers()[$header] ?? null;
if (null === $userID) { if (null === $userID) {
Log::error(sprintf('No user in header "%s".', $header)); Log::error(sprintf('No user in header "%s".', $header));
throw new FireflyException('The guard header was unexpectedly empty. See the logs.'); throw new FireflyException('The guard header was unexpectedly empty. See the logs.');