diff --git a/brutaldon/settings.py b/brutaldon/settings.py index 7e645ee..c982ffa 100644 --- a/brutaldon/settings.py +++ b/brutaldon/settings.py @@ -200,8 +200,16 @@ SESSION_SERIALIZER = "django.contrib.sessions.serializers.PickleSerializer" # URL to redirect users to when not logged in ANONYMOUS_HOME_URL = "about" -# URL to redirect gab users to -GAB_RICKROLL_URL = "https://invidio.us/watch?v=dQw4w9WgXcQ" +# URL to redirect galaxy brain users to +RICKROLL_URL = "https://invidio.us/watch?v=dQw4w9WgXcQ" + +# Function to check if trying to add an account should trigger a special response +def CHECK_INSTANCE_URL(url, redirect): + if "gab.com" in url: + return redirect(RICKROLL_URL) + elif "shitposter.club" in url: + return redirect(RICKROLL_URL) + # Version number displayed on about page BRUTALDON_VERSION = "2.14.1" diff --git a/brutaldon/views.py b/brutaldon/views.py index 1ca54f8..122d3f3 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -392,8 +392,9 @@ def login(request): redirect_uris = request.build_absolute_uri(reverse("oauth_callback")) if form.is_valid(): api_base_url = form.cleaned_data["instance"] - if "gab.com" in api_base_url: - return redirect(django_settings.GAB_RICKROLL_URL) + resp = django_settings.CHECK_INSTANCE_URL(api_base_url, redirect) + if resp is not None: + return resp tmp_base = parse.urlparse(api_base_url.lower()) if tmp_base.netloc == "": api_base_url = parse.urlunparse(