Fix: respect subpath in logout, share link and auto-login redirects (#14476)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-10-18 14:28:15 +00:00
1 parent 961f7fd672
commit 309a4b004d
8 files changed
+106 -7

No files matched your search

+6 -4
View File
@@ -4911,7 +4911,7 @@ class SharedLinkView(View):
share_link.expiration is not None
and share_link.expiration < timezone.now()
):
return HttpResponseRedirect("/accounts/login/?sharelink_expired=1")
return HttpResponseRedirect(f"{settings.LOGIN_URL}?sharelink_expired=1")
try:
return serve_file(
doc=share_link.document,
@@ -4920,14 +4920,16 @@ class SharedLinkView(View):
disposition="inline",
)
except FileNotFoundError:
return HttpResponseRedirect("/accounts/login/?sharelink_notfound=1")
return HttpResponseRedirect(
f"{settings.LOGIN_URL}?sharelink_notfound=1",
)
bundle = ShareLinkBundle.objects.filter(slug=slug).first()
if bundle is None:
return HttpResponseRedirect("/accounts/login/?sharelink_notfound=1")
return HttpResponseRedirect(f"{settings.LOGIN_URL}?sharelink_notfound=1")
if bundle.expiration is not None and bundle.expiration < timezone.now():
return HttpResponseRedirect("/accounts/login/?sharelink_expired=1")
return HttpResponseRedirect(f"{settings.LOGIN_URL}?sharelink_expired=1")
if bundle.status in {
ShareLinkBundle.Status.PENDING,