Repository navigation
fix(auth): preserve safe login return navigation after late 401s - #974
Conversation
Reuse the session return-target sanitizer at the shared auth-loss callsite. Cover cold and visited login profiles, grouped refresh, deep links, and unsafe targets. Add real-build desktop/mobile browser coverage without changing update or reload behavior. Refs #900
|
Owner delivery verified: regular merge to develop Fresh owner: 637 unit passes / 4 existing skips, 45 Foundation passes, eight original REAL-build synthetic-auth browser cases and every unchanged REAL/MOCK measurement/output/precache/budget gate passed. REAL loading bytes: initial 722645 / playback 692028 / precache 2408272 in 82 entries; MOCK 727497 / 692028 / 2412037 in 81 entries; initial HLS 0 in both. All three actual-merge postmerge workflows completed/success and original logs read: Tests, Security, existing develop automation. Postmerge: 1092 backend passes / 20 existing skips / 2 subtests, 244 main browser passes, 8 original auth cases; concurrent fresh PostgreSQL first boot, 48/48 distinct successful migrations, persisted key unchanged after restart and HTTP surface verified. No manual release/deploy. Security is base-equivalent, not all-clean: npm 25 Moderate / 2 Low / 0 High/Critical; pip 75 dependencies / 0 skipped / 0 vulnerabilities; Bandit 0 High / 2 Medium / 66 Low / 1 skipped test and 0 High/High-filtered results; Gitleaks 0 / Trivy HIGH-CRITICAL gates passed. Five current Dockerfile alerts remain in the existing #842 scope; historical old-commit alerts are separated. #900 stays open for original reload/update/real-auth criteria and #943 for update/restart acceptance. The eight synthetic-auth cases do not close those contracts. |
Summary
Refs #900. Partial return-navigation fix only. Keep #900 open.
returnTowhen late parallel API 401s arrive after login has rendered. Authentication loss on a protected page retains its path, query and hash.loginLocationForand its existing sanitizer. External, protocol-relative, JavaScript and nested-auth destinations stay rejected. Session cleanup, single-flight refresh, cookies/CSRF, genuine application updates and chunk recovery remain unchanged.e6c21f24f9081f13aa188412ea8d6b3575c3efdc, including reviewed Resolve canonical PWA precache URLs in UX06 loading measurements #1042 / fix: resolve canonical PWA URLs in UX06 loading measurements #1043. No dependency/lock, budget, scanner, service-worker behavior or threshold delta against current develop.Current exact composition
e20ebf9419d04eeb62453cc84bb2fa3dd0f53421developate6c21f24f9081f13aa188412ea8d6b3575c3efdc136db4756e1fd59bf3366658524d4fbf42c9002bbf590cedd6c90d07fa785fd59ac064d6fad14d75remains applicable to the unchanged auth regression files and minimal shared redirect. Integration was conflict-free; no new product implementation or gate relaxation.Fresh owner verification
Actual isolated
--rmPlaywright 1.63.0 Noble container, Node 24.20.0, safe exact Git export without.env*, no operator data or provider contacts:returnToretained and final target reached after synthetic login. Current late cases observe four held API 401s and one grouped refresh; the assertions are unchanged, not pinned to the historical 19-request count.Current CI and security
All 23 current-head checks completed successfully, including all seven active Required contexts matched to GitHub App 15368 in ruleset 23886776. Tests 41593793737, Security 41593793774 and Docker 41593793659 are successful. CI merge
9f649c984b4f657dcb04530e3530cd0a6eca014chas the exact tested candidate tree and expected base/head parents. Current backend CI: 1092 passed / 20 existing skips / 2 subtests, plus 12 migration foundation/orchestration tests. Main browser job: 244 passed, Foundation 5+1+5; the original return suite passes all eight cases. Integration confirms concurrent fresh PostgreSQL first boot, 48/48 distinct successful migrations, healthy applications, persisted proxy key unchanged after immediate restart and the complete HTTP surface. #1043's three exact-merge postmerge pipelines are also successful. Ready/merge is guarded again immediately against live develop and head; this does not close #900.Original current security reports were read and compared with actual develop Security 41593765744 and preceding baseline 41586781783:
Historical observations and open original criteria
/sw.jspush append but needed explicit test-only delivery of exact root build files after unchanged isolated backend routes returned 404. It does not establish full original deployment/backend-auth acceptance. The canonical public-asset repair is now separately integrated; no new version-transition acceptance is inferred.No manual release or deployment is part of this PR delivery. Existing develop branch automation runs normally after an authorized merge.