well, how I see it:

- a user can subscribe to any amount of groups during the lifecycle of his 
JWT
- how can I get a list these groups in the first place? so to be able to 
"send a message to an appropriate group"?

I thought there's a way to decode JWT, get user ID from it and then somehow:

channels = get_channel_layer():
for ws in channels.get_connections_for_user(user_id):
    ws.close()

but i couldn't find a way

On Monday, 6 April 2020 14:36:46 UTC+4, Roger Gammans wrote:
>
> Don't you just have to send a message to an appropriate group which 
> contains just that users/sessions connections/consumers and in the message 
> handler on the consumer call 'self.close()' and remove the consumer from 
> any subscriptions. 
>
> If I understand the docs, in the disconnect method is still called so can 
> do it there, and should be anyway. (Although it doesn't hurt to do it twice 
> group_discard() is defined a s NOOP if the consumer's unique channel isn't 
> in the group)
>
> Or have I missed something,?
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5673c750-b428-4ffd-87c8-7de10f19ba6e%40googlegroups.com.

Reply via email to