3x-ui/web
MHSanaei 42e2a91b92
fix(auth): invalidate other sessions when credentials change
When the admin changes username/password from one machine, sessions
on every other machine kept working until they manually logged out
because session storage is a signed client-side cookie — there is
no server-side session list to revoke.

Add a per-user LoginEpoch counter stamped into the session at login
and re-verified on every authenticated request. UpdateUser and
UpdateFirstUser bump the epoch (UpdateUser via gorm.Expr so a single
update statement is atomic), so any cookie issued before the change
no longer matches the user's current epoch and GetLoginUser returns
nil — the SPA's 401 interceptor then redirects to the login page.

Backward compatible: the column defaults to 0 and missing cookie
values are treated as 0, so sessions issued before this change
remain valid until the first credential update.
2026-05-13 12:48:13 +02:00
..
controller fix(auth): make logout POST+CSRF and propagate session loss to other tabs 2026-05-13 12:24:05 +02:00
entity feat(settings): redact secrets in AllSettingView and add TrustedProxyCIDRs 2026-05-11 21:16:22 +02:00
global Refactor code and fix linter warnings (#3627) 2026-01-05 05:54:56 +01:00
job fix(security): SSRF prevention, trusted-proxy header gating, CSP nonce, HTTP timeouts 2026-05-11 21:16:23 +02:00
locale v3 2026-05-10 02:13:42 +02:00
middleware fix(security): SSRF prevention, trusted-proxy header gating, CSP nonce, HTTP timeouts 2026-05-11 21:16:23 +02:00
network docs: add comments for all functions 2025-09-20 09:35:50 +02:00
runtime feat(nodes): traffic-writer queue, full-mirror sync, WS event fixes 2026-05-10 16:25:23 +02:00
service fix(auth): invalidate other sessions when credentials change 2026-05-13 12:48:13 +02:00
session fix(auth): invalidate other sessions when credentials change 2026-05-13 12:48:13 +02:00
translation feat(panel): xray metrics dashboard with observatory probe history 2026-05-12 02:17:45 +02:00
websocket feat(nodes): traffic-writer queue, full-mirror sync, WS event fixes 2026-05-10 16:25:23 +02:00
web.go Merge branch 'main' into fix/farhadh/security-hardening-2 2026-05-12 11:51:54 +02:00