Social Network Connect Events

The following is the list of the social network connection events and where they happen:

On Controllers

How to Work With Social Network Connect Events

This event when triggered will contain a Da\User\Model\User model instance and also a Da\User\Model\SocialNetworkAccount instance. For example:

// events.php file

use Da\User\Controller\RegistrationController;
use Da\User\Event\SocialNetworkConnectEvent;
use yii\base\Event;

    function (SocialNetworkConnectEvent $event) {

        $user = $event->getUser(); // $token is a Da\User\Model\User instance
        $account = $event->getAccount(); // $account is a Da\User\Model\SocialNetworkAccount

        // ... your logic here

© 2amigos 2013-2017