mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 16:28:59 +00:00
Ensure password resets revoke access to Streaming API
This commit is contained in:
@@ -433,6 +433,7 @@ RSpec.describe User do
|
||||
let!(:web_push_subscription) { Fabricate(:web_push_subscription, access_token: access_token) }
|
||||
|
||||
before do
|
||||
allow(redis).to receive_messages(publish: nil)
|
||||
user.reset_password!
|
||||
end
|
||||
|
||||
@@ -448,6 +449,10 @@ RSpec.describe User do
|
||||
expect(Doorkeeper::AccessToken.active_for(user).count).to eq 0
|
||||
end
|
||||
|
||||
it 'revokes streaming access for all access tokens' do
|
||||
expect(redis).to have_received(:publish).with("timeline:access_token:#{access_token.id}", Oj.dump(event: :kill)).once
|
||||
end
|
||||
|
||||
it 'removes push subscriptions' do
|
||||
expect(Web::PushSubscription.where(user: user).or(Web::PushSubscription.where(access_token: access_token)).count).to eq 0
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user