3x-ui/util
MHSanaei bbefe91011
fix(auth): invalidate sessions when 2FA is enabled, fix dev 401 loop
Add UserService.BumpLoginEpoch and call it from updateSetting when
TwoFactorEnable flips false → true. Existing cookies (issued under
the looser no-2FA policy) get a 401 on their next request and are
forced through the login flow. Disabling 2FA is a relaxation and
does not bump the epoch — sessions stay valid.

Also fix the dev-mode 401 redirect: targeting `${basePath}login.html`
breaks when basePath isn't "/" (Vite has no file at e.g.
"/test/login.html"; the SPA fallback loops the 401). Navigate to
basePath instead — Vite's bypassMigratedRoute and Go's index
handler both serve login.html for that path.

Strip stale doc-comment from netsafe and IndexController.logout
in line with the project's no-inline-comments convention.
2026-05-13 14:08:16 +02:00
..
common v3 2026-05-10 02:13:42 +02:00
crypto Refactor code and fix linter warnings (#3627) 2026-01-05 05:54:56 +01:00
json_util docs: add comments for all functions 2025-09-20 09:35:50 +02:00
ldap Refactor code and fix linter warnings (#3627) 2026-01-05 05:54:56 +01:00
netsafe fix(auth): invalidate sessions when 2FA is enabled, fix dev 401 loop 2026-05-13 14:08:16 +02:00
random Refactor code and fix linter warnings (#3627) 2026-01-05 05:54:56 +01:00
reflect_util Refactor code and fix linter warnings (#3627) 2026-01-05 05:54:56 +01:00
sys fix windows build 2026-02-20 02:07:46 +01:00