FeatureFuel
3

Add autoRefresh Option to getUser() to Ensure Session Data is Synced with Latest User State

Source: supabase/supabase#35789 · opened by @YounesZADI
Problem: Currently, fetches the latest user data from the server but does not automatically check if the client’s session (e.g., session.user) is up to date with this data. If the user’s data (e.g., email, metadata) is modified elsewhere, the client’s session retains stale data until manually refreshed, leading to inconsistencies. Developers must write extra code to compare session.user with getUser() results and manually refresh the session if outdated. Proposed Solution: Add a parameter to , such as , to: Check if the session’s user data matches the latest getUser() result (e.g., via updated_at or custom fields). Automatically refresh the session (via ) if discrepancies are found. Example Usage: Benefits: Reduces boilerplate code for developers. Ensures session and user data consistency by default. Simplifies real-time sync workflows. Note to Supabase Team: This feature would streamline auth state management and align with developer expectatio…

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests