From 3c1f44f554a053847f2da50b166e5efd2b2ce264 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 1 Jan 2023 15:27:14 +0100 Subject: [PATCH] Fix https://github.com/firefly-iii/firefly-iii/issues/6788 --- app/Http/Middleware/Authenticate.php | 2 ++ app/Support/Authentication/RemoteUserGuard.php | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index bacdcf6547..ba3d72b53d 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -123,6 +123,8 @@ class Authenticate Log::debug('Guard array is not empty.'); foreach ($guards as $guard) { + Log::debug(sprintf('Now in guard loop, guard is "%s"', $guard)); + $this->auth->guard($guard)->authenticate(); if ($this->auth->guard($guard)->check()) { /** @noinspection PhpVoidFunctionResultUsedInspection */ return $this->auth->shouldUse($guard); // @phpstan-ignore-line diff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.php index 1086ddaa58..b5b0235b62 100644 --- a/app/Support/Authentication/RemoteUserGuard.php +++ b/app/Support/Authentication/RemoteUserGuard.php @@ -119,7 +119,6 @@ class RemoteUserGuard implements Guard public function guest(): bool { Log::debug(sprintf('Now at %s', __METHOD__)); - $this->authenticate(); return !$this->check(); } @@ -129,7 +128,6 @@ class RemoteUserGuard implements Guard public function check(): bool { Log::debug(sprintf('Now at %s', __METHOD__)); - $this->authenticate(); return !is_null($this->user()); } @@ -139,7 +137,7 @@ class RemoteUserGuard implements Guard public function user(): ?User { Log::debug(sprintf('Now at %s', __METHOD__)); - $this->authenticate(); + //$this->authenticate(); return $this->user; }