[GH-ISSUE #1760] Session Validation on Tab Focus Without Page Refresh #26226

Closed
opened 2026-04-17 16:42:47 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @danteyc on GitHub (Mar 10, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1760

Hello!

When a session is active, the authentication status is not validated when the browser tab is focused. Instead, it only updates when the page is refreshed or when navigating to another page.

Is there an equivalent to NextAuth's refetchOnWindowFocus that automatically re-fetches the session when the window is focused?

We would greatly appreciate your help!

Originally created by @danteyc on GitHub (Mar 10, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1760 Hello! When a session is active, the authentication status is not validated when the browser tab is focused. Instead, it only updates when the page is refreshed or when navigating to another page. Is there an equivalent to NextAuth's **refetchOnWindowFocus** that automatically re-fetches the session when the window is focused? We would greatly appreciate your help!
GiteaMirror added the locked label 2026-04-17 16:42:47 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 13, 2025):

Hi, @danteyc. I'm Dosu, and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You raised a request for automatic session validation when a browser tab is focused.
  • The current setup requires manual page refresh or navigation to update authentication status.
  • You suggested a feature similar to NextAuth's refetchOnWindowFocus.
  • There have been no comments or developments on this issue yet.

Next Steps:

  • Please let me know if this issue is still relevant to the latest version of the better-auth repository by commenting here.
  • If there is no response, the issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:2970839614 --> @dosubot[bot] commented on GitHub (Jun 13, 2025): Hi, @danteyc. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You raised a request for automatic session validation when a browser tab is focused. - The current setup requires manual page refresh or navigation to update authentication status. - You suggested a feature similar to NextAuth's **refetchOnWindowFocus**. - There have been no comments or developments on this issue yet. **Next Steps:** - Please let me know if this issue is still relevant to the latest version of the better-auth repository by commenting here. - If there is no response, the issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#26226