Skip to content

Conversation

@7ttp
Copy link
Contributor

@7ttp 7ttp commented Nov 26, 2025

summary

when getuser() returns a valid user, suppress the insecure user warning for subsequent getsession() calls since the developer is already following best practices by verifying the user with the supabase auth server.

problem

the warning using the user object as returned from supabase.auth.getsession()... fires every time getsession() is called, even when the developer also calls getuser() to verify the user. this creates noisy, misleading logs.

solution

set suppressgetsessionwarning = true when getuser() successfully returns a user, preventing the warning from firing on subsequent getsession() calls.

changes

  • packages/core/auth-js/src/gotrueclient.ts: added suppression logic in getuser() method

closes #1895

when getuser() returns a valid user, suppress the insecure user warning for subsequent getsession() calls since the developer is already following best practices by verifying the user with the auth server.

closes supabase#1895
@7ttp 7ttp requested review from a team as code owners November 26, 2025 13:45
@coveralls
Copy link

coveralls commented Nov 26, 2025

Coverage Status

coverage: 95.367% (-0.3%) from 95.63%
when pulling b73ef6b on 7ttp:fix/suppress-getsession-warning-after-getuser
into ad5b553 on supabase:master.

@mandarini mandarini self-assigned this Nov 26, 2025
reset suppressgetsessionwarning to false in _removesession() to ensure the security warning is re-enabled after sign-out or session changes, preventing stale suppression across different user sessions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

supabase.auth.getSession() always logs “use getUser instead,” even when we do

3 participants