绕过注册表单使用allauth [英] Bypass signup form using allauth

查看:97
本文介绍了绕过注册表单使用allauth的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道如何在django allauth中使用社交帐户时绕过注册页面?



我已经拥有了正在使用的身份验证方面Google,但是当用户接受Google的请求时,它会重定向到一个页面,要求他们在登录之前输入他们的电子邮件地址。



但是肯定会有从Google登录中检索到这些信息,并且应该能够简单地登录用户,以便他们可以使用该网站?



我该怎么做? p>

谢谢。

解决方案

您需要明确定义电子邮件范围对于您的SOCIALACCOUNT_PROVIDERS设置中的Google

 google:{'SCOPE':['https://www.googleapis.com /auth/userinfo.profile','https://www.googleapis.com/auth/userinfo.email'],
'AUTH_PARAMS':{'access_type':'online'},
}


Does anyone know how I would go about bypassing the signup page when using a social account in django allauth?

I've got the authentication side of things working with Google but when the user accepts the request from Google, it redirects to a page which asks them to enter their email address before they can log in.

But surely it will have retrieved this information from the Google login and should be able to simply log the user in so that they can use the site?

How would I go about doing that?

Thanks.

解决方案

You need to explicitly define the 'email' scope for google in your SOCIALACCOUNT_PROVIDERS settings

'google': { 'SCOPE': ['https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/userinfo.email'],
            'AUTH_PARAMS': { 'access_type': 'online' },
}

这篇关于绕过注册表单使用allauth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆