yii2-usuario
yii2-usuario copied to clipboard
The documentation to Social Network Events is obsolete.
For example, there are events described in the documentation: SocialNetworkConnectEvent::EVENT_BEFORE_CONNECT && SocialNetworkConnectEvent::EVENT_AFTER_CONNECT but they are never reached.
Registration and authorization use the same controller - security/auth, but not registartion/connect.
Thank you @ivan-cc have time fora PR?
@ivan-cc thanks for reporting. I found the issue that is happening when registration is used via social networks. The problem is that when registration is happening, is RegistrationController and not SecurityController.
The documentation is not obsolete but lacks of extra documentation referring to this point. I'll add it.
References on controllers:
- https://github.com/2amigos/yii2-usuario/blob/master/src/User/Controller/SecurityController.php#L225-L239
- https://github.com/2amigos/yii2-usuario/blob/master/src/User/Controller/RegistrationController.php#L137-L176
@maxxer needs some insights from you too. I have been following the code and it seems we have a bug.
The SocialNetworkAuthenticateService has a line that is never reached: https://github.com/2amigos/yii2-usuario/blob/master/src/User/Service/SocialNetworkAuthenticateService.php#L81
The problem is this line: https://github.com/2amigos/yii2-usuario/blob/master/src/User/Service/SocialNetworkAuthenticateService.php#L104. It creates the user so the /user/registration/connect returned by https://github.com/2amigos/yii2-usuario/blob/master/src/User/Service/SocialNetworkAuthenticateService.php#L81 is never reached, thus, never firing the events as @ivan-cc stated
@ivan-cc mind testing from master branch? I have made some changes to the SocialNetworkAuthenticateService that I believe solves the bug.
I will try to test within the next days.
Let me know @ivan-cc Thanks