mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Remote user guard accepts custom header
This commit is contained in:
parent
77658d19dd
commit
981960fcb4
@ -69,16 +69,13 @@ class RemoteUserGuard implements Guard
|
||||
return;
|
||||
}
|
||||
// Get the user identifier from $_SERVER
|
||||
$userID = request()->server('REMOTE_USER') ?? null;
|
||||
$header = config('auth.guard_header', 'REMOTE_USER');
|
||||
$userID = request()->server($header) ?? null;
|
||||
if (null === $userID) {
|
||||
Log::debug('No user in REMOTE_USER.');
|
||||
throw new FireflyException('The REMOTE_USER header was unexpectedly empty.');
|
||||
Log::error(sprintf('No user in header "%s".', $header));
|
||||
throw new FireflyException('The guard header was unexpectedly empty. See the logs.');
|
||||
}
|
||||
|
||||
|
||||
// do some basic debugging here:
|
||||
// $userID = 'test@firefly';
|
||||
|
||||
/** @var User $user */
|
||||
$user = $this->provider->retrieveById($userID);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user