Skip to content

Commit

Permalink
Fix rate-limiting incorrectly triggering a session cookie on most end…
Browse files Browse the repository at this point in the history
…points (mastodon#30483)
  • Loading branch information
ClearlyClaire authored May 30, 2024
1 parent 3fa0dd0 commit 73a78cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def throttleable_remote_ip
end

def authenticated_user_id
authenticated_token&.resource_owner_id || warden_user_id
authenticated_token&.resource_owner_id
end

def authenticated_token_id
Expand Down Expand Up @@ -142,7 +142,7 @@ def paging_request?
end

throttle('throttle_password_change/account', limit: 10, period: 10.minutes) do |req|
req.authenticated_user_id if req.put? || (req.patch? && req.path_matches?('/auth'))
req.warden_user_id if req.put? || (req.patch? && req.path_matches?('/auth'))
end

self.throttled_responder = lambda do |request|
Expand Down

0 comments on commit 73a78cc

Please sign in to comment.