users
users copied to clipboard
Error on dispatch event
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 could you show how you defined the callback?
Closing because user has not replied for almost a year