step_token = $step_token; $this->authenticator = $authenticator; $this->session = $session; $this->user_storage = $user_storage; } public function register_hook() { add_action( 'wp_login', [ $this, 'clean' ], 5 ); } public function clean() { if ( $this->user_storage->is_wp_user_set() ) { $this->step_token->reset(); $this->session->destroy(); $this->authenticator->close_authentication(); } } }