users icon indicating copy to clipboard operation
users copied to clipboard

Error on dispatch event

Open kashifau opened this issue 1 year ago • 1 comments

I am currently migrating from from cake 3.10 to cake 4. I am using cake dc users plugin v9 to implement login logic. I have also implemented 2FA and there is a method onPostVerifyCodeOkay() in Users Controller which redirects user when they have provided correct 2FA code. Following line which is executed to set user session data before redirecting them to the homepage $this->dispatchEvent(Plugin::EVENT_AFTER_LOGIN, ['user' => $user]); I am getting the following error when this line is executed Argument 1 passed to Cake\Event\EventManager::_callListener() must be callable, array given, called in /var/www/synergy3/synergy/vendor/cakephp/cakephp/src/Event/EventManager.php on line 286 This error is only shown once when user enters the correct code, if I enter the homepage url after that the user is redirected to homepage correctly. Any suggestions what is the issue and what changes should I make?

kashifau avatar Jul 18 '23 22:07 kashifau

@kashifau could you show how you defined the callback?

rochamarcelo avatar Jul 20 '23 13:07 rochamarcelo

Closing because user has not replied for almost a year

ajibarra avatar Jun 28 '24 05:06 ajibarra