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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With