Comments (7)
Can you paste a complete stack trace?
from django-allauth.
Traceback (most recent call last):
File "VIRTUALENV_PATH/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "VIRTUALENV_PATH/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "VIRTUALENV_PATH/python3.9/site-packages/allauth/socialaccount/providers/oauth2/views.py", line 84, in view
return self.dispatch(request, *args, **kwargs)
File "VIRTUALENV_PATH/python3.9/site-packages/allauth/socialaccount/providers/oauth2/views.py", line 162, in dispatch
return complete_social_login(request, login)
File "VIRTUALENV_PATH/python3.9/site-packages/allauth/socialaccount/helpers.py", line 208, in complete_social_login
sociallogin.lookup()
File "VIRTUALENV_PATH/python3.9/site-packages/allauth/socialaccount/models.py", line 282, in lookup
provider_id = self.account.get_provider().id
File "VIRTUALENV_PATH/python3.9/site-packages/allauth/socialaccount/models.py", line 141, in get_provider
provider = self._provider = adapter.get_provider(
File "VIRTUALENV_PATH/python3.9/site-packages/allauth/socialaccount/adapter.py", line 205, in get_provider
app = self.get_app(request, provider=provider)
File "VIRTUALENV_PATH/python3.9/site-packages/allauth/socialaccount/adapter.py", line 290, in get_app
raise MultipleObjectsReturned
Exception Type: MultipleObjectsReturned at /accounts/facebook/login/callback/
Raised during: allauth.socialaccount.providers.oauth2.views.view
Request information:
USER: AnonymousUser
Following the stack trace I see it might be here that the request gets lost?
Looking at the stack trace was definitely better than me randomly looking at the code. Thank you for pointing me to it.
from django-allauth.
The culprit is this line of code:
provider_id = self.account.get_provider().id
In order to return the provider we need to lookup the app, as that is a property of the provider instance (provider.app
). But, in your case, there are multiple apps, so get_provider()
gets confused. While passing request here (get_provider(request)
) would solve the issue, we actually don't need the full provider here, only its ID. To be fixed.
from django-allauth.
Thank you very much, it makes much more sense now.
from django-allauth.
Upon closer inspection, there are other cases that need more than the ID. Fixed via f356138.
from django-allauth.
Can you try out the current main branch?
from django-allauth.
I'm sorry I thought I sent a reply to your question. It's working perfectly for me now!
from django-allauth.
Related Issues (20)
- AttributeError: 'UserSignUpForm' object has no attribute 'try_save' HOT 1
- Assertion Error for Existing Users After Registering New User with Social Account HOT 2
- LOGIN_ON_EMAIL_CONFIRMATION does not work for users created manually eg. via admin HOT 1
- Google Social Login Error - ImmatureSignatureError: The token is not yet valid (iat)
- [tox] Can't find msgfmt HOT 2
- ModuleNotFoundError: No module named 'user' HOT 2
- 2FA Setup - QR Code/Secret Key Invalidation on Incorrect Token Entry HOT 3
- login_required CBV consistency HOT 1
- Signing up new users, facing username duplicate errors (0.61.1) HOT 10
- Regular accounts only HOT 1
- Get id_token for send to the URL logout keycloak
- Initial value for the SignUpForm
- what is `by_id()` replaced with? HOT 1
- Wrong 'da' translation of "Password Reset Email" /locale/da/LC_MESSAGES /django.po HOT 1
- Microsoft provider does not have extract_email_addresses function defined HOT 1
- TikTok provider needed HOT 5
- keep getting error retrieving access token for microsoft oauth and using 0.61.1 HOT 3
- About old version Document. HOT 1
- Password reset from key (email) issue - invalid link - solved HOT 2
- typo in `authentication_required` in headless RESTView HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-allauth.