fix ops local admin redirects

This commit is contained in:
2569718930@qq.com
2026-06-14 22:44:02 +08:00
parent 8bbe8f74c1
commit a9e9eed2f1
6 changed files with 119 additions and 2 deletions
@@ -216,9 +216,13 @@ export function runTests() {
const optionalRefreshIndex = middlewareSource.indexOf(
"function shouldRefreshOptionalSupabaseSession",
);
const publicApiFunction = middlewareSource.slice(
middlewareSource.indexOf("function isPublicApi"),
middlewareSource.indexOf("function shouldRefreshOptionalSupabaseSession"),
);
assert(
optionalRefreshIndex >= 0 &&
!middlewareSource.includes('pathname === "/api/system/status"'),
!publicApiFunction.includes('pathname === "/api/system/status"'),
"middleware must not treat system status as public after it becomes an ops-only API",
);