Allow authentication urls under /list/_auth/
authorMagnus Hagander <magnus@hagander.net>
Tue, 18 Jun 2019 14:55:47 +0000 (16:55 +0200)
committerMagnus Hagander <magnus@hagander.net>
Tue, 18 Jun 2019 14:55:47 +0000 (16:55 +0200)
This allows the authentication to work even when used behind a varnish
proxy that eats all other URLs than those directly to the archives.

To make use of this, LOGIN_URL must also be changed to point to
/list/_auth/accounts/login/, and the entry in the community
authentication system must point to /list/_auth/auth_receive/.

django/archives/urls.py

index 67dd3e14d269c5f0576efcbcb2da670e46f4a0c1..cc8732ec4290744affb1b8da1a461b15686da09d 100644 (file)
@@ -69,7 +69,7 @@ if settings.ALLOW_RESEND or not settings.PUBLIC_ARCHIVES:
 
     urlpatterns += [
         # For non-public archives, support login
-        url(r'^accounts/login/?$', archives.auth.login),
-        url(r'^accounts/logout/?$', archives.auth.logout),
-        url(r'^auth_receive/$', archives.auth.auth_receive),
+        url(r'^(?:list/_auth/)?accounts/login/?$', archives.auth.login),
+        url(r'^(?:list/_auth/)?accounts/logout/?$', archives.auth.logout),
+        url(r'^(?:list/_auth/)?auth_receive/$', archives.auth.auth_receive),
     ]