Skip to content

Commit 9c70d80

Browse files
authored
OAuth: redirect Bitbucket to the old dashboard (#453)
Bitbucket doesn't allow more than one callback URL for their OAuth app, so we are redirecting users to the old dashboard for now.
1 parent c4d40d6 commit 9c70d80

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

readthedocsext/theme/templates/socialaccount/snippets/provider_list.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{% load socialaccount %}
2-
{% load i18n %}
1+
{% load get_providers provider_login_url from socialaccount %}
2+
{% load trans blocktrans from i18n %}
33

44
{% get_providers as socialaccount_providers %}
55

@@ -11,9 +11,10 @@
1111
{% if provider.id != 'saml' %}
1212
{% if allowed_providers and provider.id in allowed_providers or not allowed_providers %}
1313
<li class="item">
14+
{# Bitbucket doesn't allow more than one callback URL for their OAuth app, so we are redirecting users to the old dashboard for now. #}
1415
<form class="ui form"
15-
method="post"
16-
action="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params %}">
16+
method="{% if provider.id == "bitbucket_oauth2" %}get{% else %}post{% endif %}"
17+
action="{% if provider.id == "bitbucket_oauth2" %}https://{{ PUBLIC_DOMAIN|cut:"app." }}{% endif %}{% provider_login_url provider.id process=process scope=scope auth_params=auth_params %}">
1718
{% csrf_token %}
1819
<button class="ui button" type="submit" title="{{ provider.name }}">
1920
<i class="fa-brands fa-{{ provider.name|lower }} icon"></i>

0 commit comments

Comments
 (0)