[Answered ]-Django allauth โ€“ How to know if user is logged in with socialaccount or account?

2๐Ÿ‘

You can use the template tag: get_social_accounts

As per documentation:

{% get_social_accounts user as accounts %}
Then:
    {{accounts.twitter}} -- a list of connected Twitter accounts
    {{accounts.twitter.0}} -- the first Twitter account
    {% if accounts %} -- if there is at least one social account

And if the user is not connected with a social account:

{% if user.is_anonymous %}Not logged in.{% else %} Logged in.{% endif %}
๐Ÿ‘คJesse

Leave a comment