Skip to content
Draft
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions arches/app/templates/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h1>{% blocktrans %}Arches | {{version}}{% endblocktrans %}</h1>
{% endif %}
{% if user.username == 'anonymous' %}
<li>
<a class="application-login" id="auth-link" href="{% url 'auth' %}?next={% url 'home' %}{% if user.username != 'anonymous' %}&logout=true{% endif %}">{% trans "Sign in" %}</a>
<a class="application-login" id="auth-link" href="{% url 'auth' %}">{% trans "Sign in" %}</a>
</li>
{% else %}
<li>
Expand All @@ -110,7 +110,7 @@ <h1>{% blocktrans %}Arches | {{version}}{% endblocktrans %}</h1>
</a>
</li>
<li>
<a class="application-login" href="{% url 'auth' %}?next={% url 'home' %}{% if user.username != 'anonymous' %}&logout=true{% endif %}">{% trans 'Log off' %}</a>
<a class="application-login" href="{% url 'auth' %}?logout=true">{% trans 'Log off' %}</a>
</li>
{% endif %}
{% if show_language_swtich %}
Expand Down
12 changes: 7 additions & 5 deletions arches/app/views/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

class LoginView(View):
def get(self, request):
next = request.GET.get("next", reverse("home"))
next = request.GET.get("next", settings.LOGIN_REDIRECT_URL)
registration_success = request.GET.get("registration_success")

if request.GET.get("logout", None) is not None:
Expand Down Expand Up @@ -105,7 +105,7 @@ def get(self, request):
)
def post(self, request):
# POST request is taken to mean user is logging in
next = request.POST.get("next", reverse("home"))
next = request.POST.get("next", settings.LOGIN_REDIRECT_URL)

if getattr(request, "limited", False):
return render(
Expand Down Expand Up @@ -578,7 +578,7 @@ def post(self, request):
password = request.POST.get("password", None)
user = authenticate(username=username, password=password)

next = request.POST.get("next", reverse("home"))
next = request.POST.get("next", settings.LOGIN_REDIRECT_URL)
user_has_enabled_two_factor_authentication = request.POST.get(
"user-has-enabled-two-factor-authentication", None
)
Expand Down Expand Up @@ -736,7 +736,7 @@ def get(self, request):

class ExternalOauth(View):
def start(request):
next = request.GET.get("next", reverse("home"))
next = request.GET.get("next", settings.LOGIN_REDIRECT_URL)
username = request.GET.get("username", None)

token, user = ExternalOauthAuthenticationBackend.get_token_for_username(
Expand All @@ -758,7 +758,9 @@ def start(request):
) # exempt; returned from other oauth2 authorization server, handled by 'oauth_state' in session
def callback(request):
next_url = (
request.session["next"] if "next" in request.session else reverse("home")
request.session["next"]
if "next" in request.session
else settings.LOGIN_REDIRECT_URL
)
user = authenticate(
request, username=request.session["user"], sso_authentication=True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ <h1>{% blocktrans %}Arches | {{version}}{% endblocktrans %}</h1>
{% endif %}
{% if user.username == 'anonymous' %}
<li>
<a class="application-login" id="auth-link" href="{% url 'auth' %}?next={% url 'home' %}{% if user.username != 'anonymous' %}&logout=true{% endif %}">{% trans "Sign in" %}</a>
<a class="application-login" id="auth-link" href="{% url 'auth' %}">{% trans "Sign in" %}</a>
</li>
{% else %}
<li>
Expand All @@ -109,7 +109,7 @@ <h1>{% blocktrans %}Arches | {{version}}{% endblocktrans %}</h1>
</a>
</li>
<li>
<a class="application-login" href="{% url 'auth' %}?next={% url 'home' %}{% if user.username != 'anonymous' %}&logout=true{% endif %}">{% trans 'Log off' %}</a>
<a class="application-login" href="{% url 'auth' %}?logout=true">{% trans 'Log off' %}</a>
</li>
{% endif %}
{% if show_language_swtich %}
Expand Down
2 changes: 2 additions & 0 deletions arches/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,8 @@
# If True, users cannot log in unless they have enabled two-factor authentication
FORCE_TWO_FACTOR_AUTHENTICATION = False

LOGIN_REDIRECT_URL = "home"

# bounds for search results hex binning fabric (search grid).
# a smaller bbox will give you less distortion in hexes and better performance
DEFAULT_BOUNDS = {
Expand Down
2 changes: 1 addition & 1 deletion releases/7.6.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
- Fix regression in original fix (#11748) for slow reports when used on systems with many related resources [#11959](https://github.com/archesproject/arches/pull/11959)
- Prevents `settings_utils.generate_frontend_configuration()` from writing to stdout, which breaks some automation scripts [#11979](https://github.com/archesproject/arches/pull/11979)
- Issue Timewheel Clear filter [#11998] (https://github.com/archesproject/arches/issues/11998)

- Excludes build directory and staticfiles directory from typescript checking [#11978](https://github.com/archesproject/arches/pull/11978)
- Allows admins to specify default landing page after login [#12034](https://github.com/archesproject/arches/issues/12034)

### Dependency changes:

Expand Down