Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AuthAlreadyAssociated: This twitter account is already in use. #99

Open
modulitos opened this issue Nov 7, 2017 · 0 comments
Open

AuthAlreadyAssociated: This twitter account is already in use. #99

modulitos opened this issue Nov 7, 2017 · 0 comments

Comments

@modulitos
Copy link
Member

modulitos commented Nov 7, 2017

To reproduce:

Open a private tab, and log in with your Twitter account.

Open another private tab, and log in again with that same Twitter account. You'll get a DRF error page w/ 500 response, and we will have this error on the server (listed below).

A simple solution would be to handle this error better on the server, and return a helpful message to the user. This is a problem when a user auths into multiple sites. I can think of only 2 ways to avoid this:

  • Create a new Twitter app id for every new domain that we have
  • Require the user to log out of one website before logging into another website.
  • Automatically log the user of out the other website when they log into a new website. Not sure if this is possible, though.
[07/Nov/2017 17:49:56] "GET /api/v2/users/login/twitter/ HTTP/1.0" 302 0
ERROR 2017-11-07 17:50:02,342 django.request: Internal Server Error: /api/v2/users/complete/twitter/
Traceback (most recent call last):
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/apps/django_app/utils.py", line 51, in wrapper
    return func(request, backend, *args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/apps/django_app/views.py", line 28, in complete
    redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/actions.py", line 43, in do_complete
    user = backend.complete(user=user, *args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/backends/base.py", line 41, in complete
    return self.auth_complete(*args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/utils.py", line 229, in wrapper
    return func(*args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/backends/oauth.py", line 182, in auth_complete
    return self.do_auth(access_token, *args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/utils.py", line 229, in wrapper
    return func(*args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/backends/oauth.py", line 193, in do_auth
    return self.strategy.authenticate(*args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/strategies/django_strategy.py", line 96, in authenticate
    return authenticate(*args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 60, in authenticate
    user = backend.authenticate(**credentials)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/backends/base.py", line 82, in authenticate
    return self.pipeline(pipeline, *args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/backends/base.py", line 85, in pipeline
    out = self.run_pipeline(pipeline, pipeline_index, *args, **kwargs)
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/backends/base.py", line 112, in run_pipeline
    result = func(*args, **out) or {}
  File "/home/me/.virtualenvs/mapseed-api/lib/python2.7/site-packages/social/pipeline/social_auth.py", line 24, in social_user
    raise AuthAlreadyAssociated(backend, msg)
AuthAlreadyAssociated: This twitter account is already in use.
[07/Nov/2017 17:50:02] "GET /api/v2/users/complete/twitter/?redirect_state=Xe0VHDAn7dVsDjeXjrOiF8SSlmYF3HoL&oauth_token=T2HiPwAAAAAAdmDaAAABX5eaWZg&oauth_verifier=oF0HSVk6T35wls98Lf9GdO9qJpBPZ1PF HTTP/1.0" 500 25599
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant