TransparentHealth / smh_app

Share My Health App: An application for Community Members and Community Based Organizations
Apache License 2.0
2 stars 3 forks source link

AuthAlreadyAssociated at /social-auth/complete/vmi/ #84

Closed sharrisoncaktus closed 5 years ago

sharrisoncaktus commented 5 years ago

When a user has logged into VMI from smh_app, there is an "AuthAlreadyAssociated at /social-auth/complete/vmi/" error with the following message:

Environment:

Request Method: GET
Request URL: http://sharemyhealthapp:8002/social-auth/complete/vmi/?code=ahT9rysv5QlqFgIputNGEWL7Rk157m&state=X52RKALysLh9bb68qt5XY5FK3KY6OQNq

Django Version: 2.1.7
Python Version: 3.7.3
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'localflavor',
 'phonenumber_field',
 'apps.common',
 'apps.resources',
 'apps.sharemyhealth',
 'apps.vmi',
 'apps.org',
 'apps.member',
 'apps.users',
 'social_django']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'social_django.middleware.SocialAuthExceptionMiddleware']

Traceback:

File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
  54.         return view_func(*args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/social_django/utils.py" in wrapper
  49.             return func(request, backend, *args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/social_django/views.py" in complete
  33.                        *args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/social_core/actions.py" in do_complete
  43.         user = backend.complete(user=user, *args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/social_core/backends/base.py" in complete
  40.         return self.auth_complete(*args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/social_core/utils.py" in wrapper
  251.             return func(*args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/social_core/backends/oauth.py" in auth_complete
  405.                             *args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/social_core/utils.py" in wrapper
  251.             return func(*args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/social_core/backends/oauth.py" in do_auth
  416.         return self.strategy.authenticate(*args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/social_django/strategy.py" in authenticate
  107.         return authenticate(*args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/django/contrib/auth/__init__.py" in authenticate
  73.             user = backend.authenticate(request, **credentials)

File "/usr/local/lib/python3.7/site-packages/social_core/backends/base.py" in authenticate
  80.         return self.pipeline(pipeline, *args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/social_core/backends/base.py" in pipeline
  83.         out = self.run_pipeline(pipeline, pipeline_index, *args, **kwargs)

File "/usr/local/lib/python3.7/site-packages/social_core/backends/base.py" in run_pipeline
  113.             result = func(*args, **out) or {}

File "/usr/local/lib/python3.7/site-packages/social_core/pipeline/social_auth.py" in social_user
  23.             raise AuthAlreadyAssociated(backend, msg)

Exception Type: AuthAlreadyAssociated at /social-auth/complete/vmi/
Exception Value: This account is already in use.