diff --git a/src/Authentication/AuthenticatorInterface.php b/src/Authentication/AuthenticatorInterface.php index a4ee56e24..10550b051 100644 --- a/src/Authentication/AuthenticatorInterface.php +++ b/src/Authentication/AuthenticatorInterface.php @@ -50,7 +50,7 @@ public function loginById($userId): void; * * @see https://codeigniter4.github.io/CodeIgniter4/extending/authentication.html */ - public function logout(): bool; + public function logout(): void; /** * Returns the currently logged in user. diff --git a/src/Authentication/Authenticators/AccessTokens.php b/src/Authentication/Authenticators/AccessTokens.php index 6f2d723cc..3994a32a0 100644 --- a/src/Authentication/Authenticators/AccessTokens.php +++ b/src/Authentication/Authenticators/AccessTokens.php @@ -189,11 +189,9 @@ public function loginById($userId): void /** * Logs the current user out. */ - public function logout(): bool + public function logout(): void { $this->user = null; - - return true; } /** diff --git a/src/Authentication/Authenticators/Session.php b/src/Authentication/Authenticators/Session.php index 6c68a4c74..f2cc38b27 100644 --- a/src/Authentication/Authenticators/Session.php +++ b/src/Authentication/Authenticators/Session.php @@ -660,10 +660,10 @@ public function loginById($userId): void /** * Logs the current user out. */ - public function logout(): bool + public function logout(): void { if ($this->user === null) { - return true; + return; } helper('cookie'); @@ -686,11 +686,9 @@ public function logout(): bool $this->rememberModel->purgeRememberTokens($this->user); // Trigger logout event - $result = Events::trigger('logout', $this->user); + Events::trigger('logout', $this->user); $this->user = null; - - return $result; } /**