Skip to content

Linking to a different existing parent user while registering with google account #1091

Closed

Description

@merjekrepo

Hi,

I've come a strange issue with the social_django app. I've integrated the Google authentication and when a new user registers the system, he/she is being linked to an existing user in the auth_user table.

Here is the social_auth_usersocialauth table that includes the foreign user_id.
social_django_1

Here is the auth_user table which includes the parent user ids:
social_django_2

The migration went successfull and it generated all tables successfully.

Here is my JavaScript code:

function socialLogin() {     
        $('#divLoader').show();
        window.open('{% url 'social:begin' 'google-oauth2' %}?next=/my_page/index?close=true', '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes');  
}

The user with the id 11 in the social_auth_usersocialauth table is a different person and should not be linking to the user_id 9! Instead it should first create that user in the auth_user table and then add that user (linking) in the social_auth_usersocialauth table. It mostly works that way but sometimes causing this strange issue; i.e. linking to a different and existing user in the auth_user table. Any ideas what is happening?

Activity

  1. locked and limited conversation to collaborators on Apr 1, 2025
  2. converted this issue into a discussion #1092 on Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions