3x-ui/web/controller
MHSanaei 4e7687e2fe
fix(auth): make logout POST+CSRF and propagate session loss to other tabs
- Switch /logout from GET to POST with CSRFMiddleware so it matches the
  SPA's existing HttpUtil.post('/logout') call (previously 404'd silently)
  and blocks GET-based logout via image tags or link prefetchers. Handler
  now returns JSON; the SPA already navigates client-side.
- Return 401 (instead of 404) from /panel/api/* when the caller is a
  browser XHR (X-Requested-With: XMLHttpRequest) so the axios interceptor
  redirects to the login page on logout-in-another-tab, cookie expiry,
  and server restart. Anonymous callers still get 404 to keep endpoints
  hidden from casual scanners.
- One-shot the 401 redirect in axios-init.js and hang the rejected
  promise so queued polls don't stack reloads or surface error toasts
  while the browser is navigating away.
- Add the CSP nonce to the runtime-injected <script> in dist.go so the
  panel loads under the existing script-src 'nonce-...' policy.
- Update api-docs endpoints.js: GET /logout doc entry was missing.
2026-05-13 12:24:05 +02:00
..
api.go fix(auth): make logout POST+CSRF and propagate session loss to other tabs 2026-05-13 12:24:05 +02:00
api_docs_test.go feat(api-docs): enhance in-panel API documentation (#4312) 2026-05-13 01:47:09 +02:00
base.go Revert "feat(auth): block panel with default admin/admin credentials and guide credential change" 2026-05-13 11:19:17 +02:00
custom_geo.go v3 2026-05-10 02:13:42 +02:00
dist.go fix(auth): make logout POST+CSRF and propagate session loss to other tabs 2026-05-13 12:24:05 +02:00
inbound.go fix(security): SSRF prevention, trusted-proxy header gating, CSP nonce, HTTP timeouts 2026-05-11 21:16:23 +02:00
index.go fix(auth): make logout POST+CSRF and propagate session loss to other tabs 2026-05-13 12:24:05 +02:00
login_limiter.go Implement CSRF protection and security hardening across the application (#4179) 2026-05-07 23:36:11 +02:00
login_limiter_test.go refactor(websocket): split controller into service + thin controller 2026-05-08 00:00:44 +02:00
node.go feat(nodes): traffic-writer queue, full-mirror sync, WS event fixes 2026-05-10 16:25:23 +02:00
server.go feat(panel): xray metrics dashboard with observatory probe history 2026-05-12 02:17:45 +02:00
setting.go Revert "feat(auth): block panel with default admin/admin credentials and guide credential change" 2026-05-13 11:19:17 +02:00
util.go fix(security): SSRF prevention, trusted-proxy header gating, CSP nonce, HTTP timeouts 2026-05-11 21:16:23 +02:00
util_test.go fix(security): SSRF prevention, trusted-proxy header gating, CSP nonce, HTTP timeouts 2026-05-11 21:16:23 +02:00
websocket.go v3 2026-05-10 02:13:42 +02:00
xray_setting.go fix(security): SSRF prevention, trusted-proxy header gating, CSP nonce, HTTP timeouts 2026-05-11 21:16:23 +02:00
xui.go feat(panel): in-panel API documentation page 2026-05-11 13:57:42 +02:00