简体   繁体   English

如何使用 Python 社交身份验证拥有独特的电子邮件

[英]How to have unique emails with Python social auth

I'm using Python Social Auth (Django) with Google and Facebook and it creates different users with the same email.我将 Python Social Auth (Django) 与 Google 和 Facebook 一起使用,它使用相同的电子邮件创建不同的用户。 How do I fix that?我该如何解决?

If I log first with Google, logout, and then with Facebook, it must just associate the accounts and not create.如果我先用 Google 登录,然后注销,然后用 Facebook,它必须只是关联帐户而不是创建。

After some code reading I found this in the pipeline:经过一些代码阅读后,我在管道中发现了这个:

'social.pipeline.social_auth.associate_by_email',

So, I just added it before所以,我刚刚添加了它

'social.pipeline.user.get_username',

And it worked.它奏效了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM