aboutsummaryrefslogtreecommitdiff
path: root/routes/integration/auth-request.php
diff options
context:
space:
mode:
authorwinter Sparkles2026-08-06 23:47:34 +0100
committerwinter Sparkles2026-08-06 23:47:34 +0100
commitef14ba500ff27dd2d1fe6e5debd99f7a5fc4db10 (patch)
tree1dd707be810472b13fe8ac60f204f74dfbecf9c6 /routes/integration/auth-request.php
initial commit
Diffstat (limited to 'routes/integration/auth-request.php')
-rw-r--r--routes/integration/auth-request.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/routes/integration/auth-request.php b/routes/integration/auth-request.php
new file mode 100644
index 0000000..82d1f03
--- /dev/null
+++ b/routes/integration/auth-request.php
@@ -0,0 +1,14 @@
+<?php
+
+// nginx (and others?) auth_request style endpoint
+// returns 200 for allowed requests
+// otherwise, returns 401 and sends the login page url as a header
+
+function GET(array $config) {
+ // in the absence of any auth backends i will say No to all requests
+ http_response_code(401);
+ header(
+ $config['integration']['header-prefix'] . '-Location: https://'
+ . $config['site']['primary-domain'] . '/login'
+ );
+}