decide where to go to after connecting with django-allauth

百般思念 提交于 2019-11-29 05:06:35
pennersr

If the user is adding more social accounts to his existing (local) account, then the most logical default would be indeed to redirect to the social account connections management screen.

However, you can easily override the default by passing along a next parameter. Have a look here:

https://github.com/pennersr/django-allauth/blob/master/allauth/socialaccount/helpers.py#L125

You'll see that the next parameter is checked, falling back to the default (connections).

So, to change the default behavior, simply pass along a next parameter:

<a href="{% provider_login_url "openid" openid="https://www.google.com/accounts/o8/id" next="/success/url/" %}">Google</a>

If you are using the default templates you'll have to add next urls here:

https://github.com/pennersr/django-allauth/blob/master/allauth/templates/socialaccount/connections.html#L53

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!