yii2-usuario icon indicating copy to clipboard operation
yii2-usuario copied to clipboard

The documentation to Social Network Events is obsolete.

Open ivan-cc opened this issue 6 years ago • 6 comments
trafficstars

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.

ivan-cc avatar May 01 '19 13:05 ivan-cc

Thank you @ivan-cc have time fora PR?

tonydspaniard avatar May 28 '19 13:05 tonydspaniard

@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

tonydspaniard avatar Jun 16 '19 11:06 tonydspaniard

@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

tonydspaniard avatar Jun 16 '19 12:06 tonydspaniard

@ivan-cc mind testing from master branch? I have made some changes to the SocialNetworkAuthenticateService that I believe solves the bug.

tonydspaniard avatar Jun 17 '19 15:06 tonydspaniard

I will try to test within the next days.

ivan-cc avatar Jun 17 '19 21:06 ivan-cc

Let me know @ivan-cc Thanks

tonydspaniard avatar Jun 26 '19 08:06 tonydspaniard