From 1d7387fb18f6ffde026d2314cf3b8362f30adc00 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Sat, 25 Feb 2023 15:49:47 +0100 Subject: [PATCH] Auth: add logout hook --- src/Auth.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Auth.php b/src/Auth.php index 467e6f4..b0b2232 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -281,6 +281,7 @@ class Auth { * @return void */ public static function logout() { + $user = self :: $user; $method = ( self :: $logged_method? self :: $logged_method: @@ -292,6 +293,7 @@ class Auth { unset($_SESSION['user']); if (isset($_SESSION['auth_method'])) unset($_SESSION['auth_method']); + Hook :: trigger('logout', array('method' => $method, 'user' => $user)); if ($method) call_user_func(array(self :: $methods[$method], 'logout')); }