One instance per user

I am using jwt token authentication. I want only single instance per user, i.e. if a user is already logged in once and is online, i want first logged in user to be disconnected when same user joins again either from another device or on same device using another browser or tab.
I know uuid is generated randomly , i have fixed this issue with assigning custom uuid such that it always remains same for same user.
I know I can do it using custom prosody module but not able to find if user is online.
how to find if a user is already online ?

I’m not sure but maybe colibri will help

apt-get install jq

curl -s http://127.0.0.1:8080/colibri/conferences
curl -s http://127.0.0.1:8080/colibri/conferences/<conf-id>

curl -s http://127.0.0.1:8080/colibri/conferences/<conf-id> | jq '.contents[0].channels[].endpoint'

This checks only one JVB

Thank you, I will check