user.login:before $user, $session /site/config/config.php return [ 'hooks' => [ 'user.login:before' => function ($user, $session) { // your code goes here } ] ]