Problem/Motivation
In certain cases, the module attempts to create an user even if it already exists. In my setup, user account creation requires admin approval and hence the users can't login. The relevant code block is:
if ($drupal_user) {
if ($this->userManager->loginUser($drupal_user, 'social_auth_google')) {
return $this->redirect('user.page');
}
}
The code above assumes that if the user exists, we would definitely do an early return. However, this isn't the case in the scenario I described above. If we don't do an early return, the code goes on to attempt to create an user (which fails, of course).
Proposed resolution
Rewrite the condition to always return early if the user exists
Comments
Comment #2
hussainwebThe patch shows a message and returns early.
Comment #3
gvsoHi @hussainweb. Thanks for reporting this. It would be added to #2848144: Create authenticate method
Comment #4
hussainweb@gvso, I noted my observations in a comment in the issue you linked. On a sidenote, I think module works well enough to make it a full module. Except for a few features and bugs, the module worked fine for me. In fact, it worked well enough for an alpha or beta release. I am asking because I need to set up extra configuration in composer.json to use the module. If it was promoted to full, I could just require "drupal/social_auth_google". :)
Thank you for your work on this module.
Comment #5
gvsoI'd like to do so, but I don't have permission. I've applied to get permission to publish full projects, yet it hasn't been granted yet.
For reference, you can look at #2765445: [D8] Social Auth Google
Comment #6
gvsoThe workflow is working fine now, and this issue is outdated because of #2849715: Make Social Auth Google compatible with Social Auth Beta 3
Thanks!