fix(web): restore conditional TTL guard on visibility refresh (#443)

The forced refresh added in #442 triggers a full /api/auth round-trip
on every tab focus/visibility event. Since the JWT lifetime is now
4 hours, the original minTtlMs guard (refresh only when <60s remains)
is sufficient and avoids unnecessary auth traffic.
This commit is contained in:
Haoqing Wang
2026-04-11 22:12:20 +08:00
committed by GitHub
parent 813ac7fdda
commit 3b92268a40
+1 -1
View File
@@ -267,7 +267,7 @@ export function useAuth(authSource: AuthSource | null, baseUrl: string): {
}
const handleActive = () => {
void refreshAuth({ force: true })
void refreshAuth({ minTtlMs: 60_000 })
}
const handleVisibilityChange = () => {