summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/api/whoami.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/static/api/whoami.php b/static/api/whoami.php
new file mode 100644
index 0000000..f32cd2c
--- /dev/null
+++ b/static/api/whoami.php
@@ -0,0 +1,11 @@
+<?php
+// Return current authenticated user from nginx
+header('Content-Type: application/json');
+header('Access-Control-Allow-Origin: *');
+header('Access-Control-Allow-Credentials: true');
+
+// nginx에서 전달된 사용자 정보 읽기 (X-Auth-User 헤더 또는 REMOTE_USER)
+$user = $_SERVER['HTTP_X_AUTH_USER'] ?? $_SERVER['REMOTE_USER'] ?? '';
+
+echo json_encode(['user' => $user]);
+?>