fix(frontend): repair login session flow

Resolve login-page 401 hangs and redirect races by relying on the shared user state. Keep protected-route redirects intact, clean pending requests without unhandled rejections, and allow the dynamic icon route through the page proxy.
This commit is contained in:
ryan
2026-06-13 11:27:30 +08:00
parent 9a6bb04bf5
commit 49bd850c8b
4 changed files with 30 additions and 99 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ export function proxy(request: NextRequest) {
}
/* 页面请求:公共路由放行 */
const publicRoutes = ['/', '/login', '/register', '/callback', '/privacy', '/terms']
const publicRoutes = ['/', '/login', '/register', '/callback', '/privacy', '/terms', '/icon']
const publicPrefixes = ['/docs/', '/epay/']
if (publicRoutes.includes(pathname) || publicPrefixes.some(p => pathname.startsWith(p))) {