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.
Comments
Similar requests
Support for Retrieving Multiple Users by IDs in supabase-js
5 votes · 0 comments
Changing JWTs to RS256 to verify JWT inside getSession() anywhere
4 votes · 0 comments
Accept `auth` options passed to `createPagesServerClient`
1 vote · 0 comments
Persist session
1 vote · 0 comments
[Auth] Allow indefinite refresh token reuse
5 votes · 0 comments
No comments yet.