diff options
Diffstat (limited to 'routes/integration')
| -rw-r--r-- | routes/integration/auth-request.php | 14 |
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' + ); +} |
