Skip to content

Commit 8fcdc79

Browse files
authored
Remove twitter Oauth (#408)
* Remove Twitter/X OAuth login integration Fixes FPBASE-5NT Twitter/X OAuth has been broken since late October 2025 due to X's domain migration from twitter.com to x.com. The OAuth endpoint has been returning error code 32 (Could not authenticate you) for 1,178+ attempts affecting 263 users over 2.5 months. Since no users have contacted us about the issue and the 242 Twitter-only users can use password reset to regain access, removing the broken integration is the cleanest solution. Changes: - Remove allauth.socialaccount.providers.twitter from INSTALLED_APPS - Remove Twitter login button from login.html template - Clean up Twitter-specific adapter logic - Remove Twitter exclusion logic from provider_list.html template * undo ignore change * Add migration for year validator (2026 -> 2027)
1 parent 11e0017 commit 8fcdc79

File tree

5 files changed

+28
-20
lines changed

5 files changed

+28
-20
lines changed

backend/config/settings/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
"allauth.socialaccount", # registration
7272
"allauth.socialaccount.providers.google",
7373
"allauth.socialaccount.providers.orcid",
74-
"allauth.socialaccount.providers.twitter",
7574
"django_recaptcha",
7675
"django_filters",
7776
"reversion",

backend/fpbase/templates/account/login.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ <h1>{% trans "Sign In" %}</h1>
2626
<a href="{% provider_login_url 'google' %}" class="btn btn-google mt-2 w-100">{% icon "google" %} &nbsp; Log in with Google</a>
2727
{% elif provider.id == "orcid" %}
2828
<a href="{% provider_login_url 'orcid' %}" class="btn btn-orcid mt-2 w-100">{% icon "orcid" %} &nbsp; Log in with ORCID</a>
29-
{% elif provider.id == "twitter" %}
30-
<a href="{% provider_login_url 'twitter'%}" class="btn btn-twitter mt-2 w-100">{% icon "twitter" %} &nbsp; Log in with X</a>
3129
{% endif %}
3230
{% endfor %}
3331

backend/fpbase/templates/socialaccount/snippets/provider_list.html

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,16 @@
33
{% if socialaccount_providers %}
44
{% element provider_list %}
55
{% for provider in socialaccount_providers %}
6-
{# Exclude Twitter/X from the "connect" process (adding new accounts) #}
7-
{% if process == "connect" and provider.id == "twitter" %}
8-
{# Skip Twitter when connecting new accounts #}
9-
{% else %}
10-
{% if provider.id == "openid" %}
11-
{% for brand in provider.get_brands %}
12-
{% provider_login_url provider openid=brand.openid_url process=process as href %}
13-
{% element provider name=brand.name provider_id=provider.id href=href %}
14-
{% endelement %}
15-
{% endfor %}
16-
{% endif %}
17-
{% provider_login_url provider process=process scope=scope auth_params=auth_params as href %}
18-
{% element provider name=provider.name provider_id=provider.id href=href %}
19-
{% endelement %}
6+
{% if provider.id == "openid" %}
7+
{% for brand in provider.get_brands %}
8+
{% provider_login_url provider openid=brand.openid_url process=process as href %}
9+
{% element provider name=brand.name provider_id=provider.id href=href %}
10+
{% endelement %}
11+
{% endfor %}
2012
{% endif %}
13+
{% provider_login_url provider process=process scope=scope auth_params=auth_params as href %}
14+
{% element provider name=provider.name provider_id=provider.id href=href %}
15+
{% endelement %}
2116
{% endfor %}
2217
{% endelement %}
2318
{% endif %}

backend/fpbase/users/adapters.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,4 @@ def clean_email(self, email):
2222

2323
class SocialAccountAdapter(DefaultSocialAccountAdapter):
2424
def is_open_for_signup(self, request, sociallogin):
25-
# Prevent new signups via Twitter/X (existing users can still log in)
26-
if sociallogin.account.provider == "twitter":
27-
return False
2825
return getattr(settings, "ACCOUNT_ALLOW_REGISTRATION", True)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Generated by Django 5.2.8 on 2026-01-11 23:58
2+
3+
import django.core.validators
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('references', '0008_alter_reference_year'),
11+
]
12+
13+
operations = [
14+
migrations.AlterField(
15+
model_name='reference',
16+
name='year',
17+
field=models.PositiveIntegerField(help_text='YYYY', validators=[django.core.validators.MinLengthValidator(4), django.core.validators.MaxLengthValidator(4), django.core.validators.MinValueValidator(1960), django.core.validators.MaxValueValidator(2027)]),
18+
),
19+
]

0 commit comments

Comments
 (0)