From 9e43075df4f7aadd03689945a5ade9bd87d603ab Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Thu, 23 Mar 2023 21:16:53 -0700 Subject: [PATCH] fs: throw 412 when not logged in Signed-off-by: Varun Patil --- lib/Controller/ClustersController.php | 5 +---- lib/Manager/FsManager.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Controller/ClustersController.php b/lib/Controller/ClustersController.php index 62ffb25f..1b59a348 100644 --- a/lib/Controller/ClustersController.php +++ b/lib/Controller/ClustersController.php @@ -110,10 +110,7 @@ class ClustersController extends GenericApiController */ protected function init(string $backend): void { - $user = $this->userSession->getUser(); - if (null === $user) { - throw Exceptions::NotLoggedIn(); - } + Util::getUser(); $this->backend = ClustersBackendManager::get($backend); diff --git a/lib/Manager/FsManager.php b/lib/Manager/FsManager.php index 558d916f..d8567546 100644 --- a/lib/Manager/FsManager.php +++ b/lib/Manager/FsManager.php @@ -87,7 +87,7 @@ class FsManager // Anything else needs a user if (null === $user) { - throw new \Exception('User not logged in: no timeline root'); + throw Exceptions::NotLoggedIn(); } $uid = $user->getUID();