pennersr / django-allauth

Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
https://allauth.org
MIT License
9.47k stars 3.02k forks source link

Auto verification of an email does not work #1194

Closed eugened19 closed 8 years ago

eugened19 commented 8 years ago

Hi,

I think this is related to the following issue: https://github.com/pennersr/django-allauth/issues/569

I'm using django-allauth==0.20.0, but I checked this problem also using django-allauth==0.24.0. It still exists.

The problem:

Everything works fine if I force email verification for all users. But I'm experiencing a problem in case I turn on auto-verification for Facebook.

I need auto-verification for Facebook only So I've added 'VERIFIED_EMAIL' as shown below. This is the only change I made in comparison with forced email verification.

SOCIALACCOUNT_PROVIDERS = { 'facebook': { 'SCOPE': ['public_profile', 'email'], 'METHOD': 'js_sdk', 'VERIFIED_EMAIL': True }, }

I set a breakpoint in providers/base.py, function def cleanup_email_addresses(self, email, addresses): Email address is set as verified indeed.

But later in the process (after confirming an email) I'm getting a redirect to signup/authenticate which does not exist and I end up with 404.

Logs: [15/Nov/2015 09:03:52]"POST /en/accounts/social/signup/ HTTP/1.1" 302 0 [15/Nov/2015 09:03:54]"GET /en/accounts/social/signup/authenticate HTTP/1.1" 404 27213

My uneducated guess would be that VERIFIED_EMAIL flag somehow breaks Facebook state machine from SocialLogin

This is the comment from the code (socialaccount/models.py): state (dict): The state to be preserved during the authentication handshake. Note that this state may end up in the url

but I do not know the code that well, so help will be much appreciated.

Thank you! ED

pennersr commented 8 years ago

I am not sure where the /authenticte URL comes from, but this is not something allauth generates. Perhaps you customized things in the adapters? I also see language prefixes, such as /en/ that may be interfering. All in all, I suspect this is project specific, and not some issue in allauth. If you have something more concrete to go on, pinpointing to allauth, feel free to reopen.