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

CommentFileSizeAuthor
#2 2847914-2.patch743 byteshussainweb

Comments

hussainweb created an issue. See original summary.

hussainweb’s picture

Status: Active » Needs review
StatusFileSize
new743 bytes

The patch shows a message and returns early.

gvso’s picture

Hi @hussainweb. Thanks for reporting this. It would be added to #2848144: Create authenticate method

hussainweb’s picture

@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.

gvso’s picture

I'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

gvso’s picture

Version: » 8.x-1.x-dev
Status: Needs review » Closed (outdated)

The workflow is working fine now, and this issue is outdated because of #2849715: Make Social Auth Google compatible with Social Auth Beta 3

Thanks!