mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
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:
@@ -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 = () => {
|
||||
|
||||
Reference in New Issue
Block a user