Repository navigation
Conversation
The throttle keeps one record per user and IP address, but isSuspended(), unsuspend(), ban(), unban() and isBanned() only looked at the first record found for the user. A suspension on another address could not be seen or lifted from the backend, and a ban left sessions on other addresses alive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. WalkthroughUser ban and suspension methods now inspect or update all throttle records for that user. If no record has a null IP address, Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk:
|
The throttle keeps one record per user and IP address, but
User::isSuspended(),unsuspend(),ban(),unban()andisBanned()only looked at the first record found for the user. For a user who signed in from more than one address:ban()only bans the first record, so an existing session on another address stays signed in (Auth::check()reads the record for the current address).These methods now cover every record of the user.
ban()also makes sure a record without an IP address exists, so addresses that have no record yet are banned as well.tests/unit/models/UserThrottleTest.phpcovers this; four of its tests fail without the change.🤖 Generated with Claude Code
Summary by CodeRabbit