Open ivan-cc opened 5 years ago
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:
@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
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 notregistartion/connect
.