Files
gpt_from_scratch/website/auth_check.php
T
2026-06-12 17:19:26 +08:00

15 lines
426 B
PHP

<?php
/**
* Used by Nginx auth_request. Returns 200 if session valid, 401 otherwise.
* Also returns X-Auth-User header so Tengine can log the authenticated username.
* Deploy to /www/wwwroot/soft_download/auth_check.php
*/
session_start();
if (!empty($_SESSION['soft_download_user'])) {
header('X-Auth-User: ' . $_SESSION['soft_download_user']);
http_response_code(200);
exit;
}
http_response_code(401);
exit;