Skip to content

Commit

Permalink
[Fixes GeoNode#12167] providing multiple openid_connect django.allaut…
Browse files Browse the repository at this point in the history
…h socialproviders fails when loading login page
  • Loading branch information
mwallschlaeger committed Apr 24, 2024
1 parent f424449 commit 44bd725
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions geonode/people/templatetags/socialaccount_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def get_user_social_providers(user):
@register.simple_tag
def get_other_social_providers(user):
user_providers = get_user_social_providers(user)
user_provider_names = [p.name.lower() for p in user_providers]
user_provider_names = [p.id.lower() for p in user_providers]
other_providers = []
for provider in providers.registry.get_list():
if provider.name.lower() not in user_provider_names:
for provider in providers.registry.get_class_list():
if provider.id.lower() not in user_provider_names:
other_providers.append(provider)
return other_providers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% get_providers as socialaccount_providers %}

{% for provider in socialaccount_providers %}
{% if provider.id == "openid" %}
{% if provider.id == "openid_connect" %}
{% for brand in provider.get_brands %}
<a class="list-group-item" title="{{brand.name}}" href="{% provider_login_url provider.id openid=brand.openid_url process=process %}">
{{brand.name}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% get_other_social_providers user as other_providers %}

{% for provider in other_providers %}
{% if provider.id == "openid" %}
{% if provider.id == "openid_connect" %}
{% for brand in provider.get_brands %}
<a class="list-group-item" title="{{brand.name}}" href="{% provider_login_url provider.id openid=brand.openid_url process=process %}">
{{brand.name}}
Expand Down

0 comments on commit 44bd725

Please sign in to comment.