mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
push_notifications: Clear PushDeviceToken on API key change.
Backported for 2.0.7 security release. This includes adding a new endpoint to the push notification bouncer interface, and code to call it appropriately after resetting a user's personal API key. When we add support for a user having multiple API keys, we may need to add an additional key here to support removing keys associated with just one client.
This commit is contained in:
@@ -3205,6 +3205,10 @@ def do_regenerate_api_key(user_profile: UserProfile, acting_user: UserProfile) -
|
||||
)),
|
||||
bot_owner_user_ids(user_profile))
|
||||
|
||||
event = {'type': 'clear_push_device_tokens',
|
||||
'user_profile_id': user_profile.id}
|
||||
queue_json_publish("deferred_work", event)
|
||||
|
||||
def do_change_avatar_fields(user_profile: UserProfile, avatar_source: str) -> None:
|
||||
user_profile.avatar_source = avatar_source
|
||||
user_profile.avatar_version += 1
|
||||
|
||||
Reference in New Issue
Block a user