From c6306af73ba9d4e2892fc013761980c43e2196d0 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Sun, 17 May 2026 10:09:31 +0300 Subject: [PATCH] implement: move null/empty token guard into logout use case Green phase: execute() accepts ?string, returns early for null or empty string, otherwise delegates to repository. --- backend/app/Auth/UseCases/Logout/Logout.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/app/Auth/UseCases/Logout/Logout.php b/backend/app/Auth/UseCases/Logout/Logout.php index 793666b..f702346 100644 --- a/backend/app/Auth/UseCases/Logout/Logout.php +++ b/backend/app/Auth/UseCases/Logout/Logout.php @@ -11,8 +11,12 @@ class Logout ) { } - public function execute(string $token): void + public function execute(?string $token): void { + if (! is_string($token) || $token === '') { + return; + } + $this->sessionRepo->deleteByToken($token); } }