1

I saw the code in the accepted answer for this question:

How to access user names and profiles with django-allauth

But when I run a template with {{user.get_provider}}, nothing appears. I was expecting it to say either "LinkedIn Oauth2" or maybe "native". (Those are my two ways to log in.)

Are there special things you need to get the template calls working? Other template items are working fine, such as account.get_avatar_url.

Community
  • 1
  • 1
Carlos
  • 5,991
  • 6
  • 43
  • 82

1 Answers1

1

To my knowledge the user profile doesn't record which credential was used to establish the current session, nor as far as I am aware does a list of a particular account's associated credential types automatically populate into the user context object (I'm not sure which you were trying to get from the question you asked).

You can access what credentials an account has available to it in python & export these to the context. See the socialaccount/connections.html template that comes with django-allauth as an example.

geewiz
  • 2,206
  • 1
  • 10
  • 16