mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-27 21:26:41 +00:00
Ensure password resets revoke access to Streaming API
This commit is contained in:
@@ -359,6 +359,13 @@ class User < ApplicationRecord
|
||||
Doorkeeper::AccessToken.by_resource_owner(self).in_batches do |batch|
|
||||
batch.update_all(revoked_at: Time.now.utc)
|
||||
Web::PushSubscription.where(access_token_id: batch).delete_all
|
||||
|
||||
# Revoke each access token for the Streaming API, since `update_all``
|
||||
# doesn't trigger ActiveRecord Callbacks:
|
||||
# TODO: #28793 Combine into a single topic
|
||||
batch.each do |token|
|
||||
redis.publish("timeline:access_token:#{token.id}", Oj.dump(event: :kill))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user