mirror of
https://gitlab.com/brutaldon/brutaldon
synced 2025-06-05 21:49:32 +02:00
Redirect gab users to a configurable URL rather than logging them in.
The default URL is "Never Gonna Give You Up" on invidio.us.
This commit is contained in:
@@ -199,5 +199,8 @@ SESSION_SERIALIZER = "django.contrib.sessions.serializers.PickleSerializer"
|
|||||||
# URL to redirect users to when not logged in
|
# URL to redirect users to when not logged in
|
||||||
ANONYMOUS_HOME_URL = "about"
|
ANONYMOUS_HOME_URL = "about"
|
||||||
|
|
||||||
|
# URL to redirect gab users to
|
||||||
|
GAB_RICKROLL_URL = "https://invidio.us/watch?v=dQw4w9WgXcQ"
|
||||||
|
|
||||||
# Version number displayed on about page
|
# Version number displayed on about page
|
||||||
BRUTALDON_VERSION = "2.12.1"
|
BRUTALDON_VERSION = "2.12.1"
|
||||||
|
@@ -352,6 +352,8 @@ def login(request):
|
|||||||
redirect_uris = request.build_absolute_uri(reverse("oauth_callback"))
|
redirect_uris = request.build_absolute_uri(reverse("oauth_callback"))
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
api_base_url = form.cleaned_data["instance"]
|
api_base_url = form.cleaned_data["instance"]
|
||||||
|
if "gab.com" in api_base_url:
|
||||||
|
return redirect(django_settings.GAB_RICKROLL_URL)
|
||||||
tmp_base = parse.urlparse(api_base_url.lower())
|
tmp_base = parse.urlparse(api_base_url.lower())
|
||||||
if tmp_base.netloc == "":
|
if tmp_base.netloc == "":
|
||||||
api_base_url = parse.urlunparse(
|
api_base_url = parse.urlunparse(
|
||||||
@@ -461,6 +463,8 @@ def old_login(request):
|
|||||||
form = LoginForm(request.POST)
|
form = LoginForm(request.POST)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
api_base_url = form.cleaned_data["instance"]
|
api_base_url = form.cleaned_data["instance"]
|
||||||
|
if "gab.com" in api_base_url:
|
||||||
|
return redirect(django_settings.GAB_RICKROLL_URL)
|
||||||
tmp_base = parse.urlparse(api_base_url.lower())
|
tmp_base = parse.urlparse(api_base_url.lower())
|
||||||
if tmp_base.netloc == "":
|
if tmp_base.netloc == "":
|
||||||
api_base_url = parse.urlunparse(
|
api_base_url = parse.urlunparse(
|
||||||
|
Reference in New Issue
Block a user