Skip to content

Conversation

@mandarini
Copy link
Contributor

Summary

Fixes false positive security warnings by moving the proxy from the session level to the user object level.

Changes

  • Before: Warning triggered when accessing session.user
  • After: Warning triggers when accessing properties like session.user.id

This eliminates false positives from JSON.stringify(), internal SDK checks, and framework object inspection while maintaining security for actual insecure usage patterns.

Testing

  • Updated existing warning tests to reflect new behavior
  • Added tests for edge cases: destructuring, spread operator, Object.keys(), JSON.stringify()

Fixes #1709

@mandarini mandarini requested a review from hf October 29, 2025 17:13
@github-actions github-actions bot added the auth-js Related to the auth-js library. label Oct 29, 2025
@coveralls
Copy link

Coverage Status

coverage: 95.455% (-0.4%) from 95.853%
when pulling 9a75634 on fix/session-user
into e8a644e on master.

@mandarini mandarini marked this pull request as ready for review October 29, 2025 17:23
@mandarini mandarini requested review from a team as code owners October 29, 2025 17:23
@mandarini mandarini self-assigned this Oct 29, 2025
@mandarini mandarini merged commit 0a76a61 into master Oct 30, 2025
26 of 27 checks passed
@mandarini mandarini deleted the fix/session-user branch October 30, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth-js Related to the auth-js library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

user object warning logged, even when not touching session.user

4 participants