After connecting an account with a social app using django-allauth the user is redirected to accounts/social/connections. How can I change this behavior?
accounts/social/connections
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).
next
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
1.4m articles
1.4m replys
5 comments
57.0k users