Skip to content
Open
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
19 changes: 15 additions & 4 deletions adhocracy-plus/templates/socialaccount/snippets/provider_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,21 @@ <h4>{% translate "Login with social media account" %}</h4>
{% if provider.id == "openid" %}
{% for brand in provider.get_brands %}
<div class="col-lg-6 pb-3">
<a title="{{ brand.name }}"
class="socialaccount-provider {{ provider.id }} {{ brand.id }}"
href="{% provider_login_url provider.id openid=brand.openid_url process=process %}"
>{{ brand.name }}</a>
<a
title="{{ brand.name }}"
class="socialaccount-provider {{ provider.id }} {{ brand.id }}"
href="
{% if provider.id == 'github' %}
{% provider_login_url provider.id openid=brand.openid_url process=process next='/accounts/3rdparty/signup/' %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does github need this but no other provider?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, I read the PR description now.

I think it would be cool to test it without the conditional, and see if the next parameter works with everything

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shn-liqd I'm not sure but I think the next url might interfere with what facebook expects for this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used to test with the dummy provider.
In your local.py we can extend the INSTALLED_APPS with a dummy SSO provider
ref: https://github.com/pennersr/django-allauth/blob/b74b04a8261486db8a3823c26c188820aed599aa/examples/react-spa/backend/backend/settings.py#L32

Then also add in the local.py:

SOCIALACCOUNT_PROVIDERS = {
    'dummy': {
        'APP': {
            'client_id': 'dummy',
            'secret': 'dummy',
        }
    }
}

run the migrate command, and I can't remember from the top of my head if a dummy button appears, if not then, go visit the url accounts/dummy/login

{% elif provider.id == 'apple' %}
{% provider_login_url provider.id openid=brand.openid_url process=process next='/accounts/apple/callback/' %}
{% else %}
{% provider_login_url provider.id openid=brand.openid_url process=process %}
{% endif %}
"
>
{{ brand.id }}
</a>
</div>
{% endfor %}
{% endif %}
Expand Down