Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fixes #12167] providing multiple openid_connect django.allauth socialproviders fails when loading login page #12169

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 3 additions & 3 deletions geonode/templates/socialaccount/snippets/provider_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
{% 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 %}">
<a class="list-group-item" title="{{brand.name}}" href="{% provider_login_url provider openid=brand.openid_url process=process %}">
{{brand.name}}
</a>
{% endfor %}
{% endif %}
<div class="form-group">
<a class="btn btn-default btn-block" title="{{provider.name}}" href="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params %}">
<a class="btn btn-default btn-block" title="{{provider.name}}" href="{% provider_login_url provider process=process scope=scope auth_params=auth_params %}">
<i class="fa fa-{{ provider.name|lower }}-square fa-2x" aria-hidden="true"></i>
{% if process == "login" %}
{% trans "Sign in with" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
{% 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 %}">
<a class="list-group-item" title="{{brand.name}}" href="{% provider_login_url provider openid=brand.openid_url process=process %}">
{{brand.name}}
</a>
{% endfor %}
{% endif %}
<div class="form-group">
<a class="btn btn-default btn-block" title="{{provider.name}}" href="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params %}">
<a class="btn btn-default btn-block" title="{{provider.name}}" href="{% provider_login_url provider process=process scope=scope auth_params=auth_params %}">
<i class="fa fa-{{ provider.name|lower }}-square fa-2x" aria-hidden="true"></i>
{% if process == "login" %}
{% trans "Sign in with" %}
Expand Down
Loading