Prevent users from entering multiple times

Hi,
I use Jitsi meet for an online school.
I use jitsi meet with JWT token authentication and user roles are based on JWT tokens. Jitsi meet is integrated with the school’s LMS so one can enter his dashboard on the LMS and click the button which redirects him to class link (link contains JWT) for them to join.
Some students click on the button many times and enter the class with multiple instance, causing quality problems with the class.
How can I prevent a person from entering multiple times?
Thanks in advance

I have implemented it as follows.

  1. I have login screen of my application.
  2. When participant joins I join them in VC using jwt token.
  3. At this time I store user jitsi I’d (using videoconferencejoined API) and store in database.
  4. If user rejoins I store new Id in database and send a data message to old id and logout that user automatically.

Thank you very much :slight_smile: @kkd

Can you please provide me an example of how to do that?

Actually it is participantJoined

Where do you listen to that event?
In teacher’s device or in the student which jist joined?

It depends on you.
You can listen on all devices if you want teachers also to login single session,

Can it be done this way?
User joins the VC, and api listens for other user joins.
if the name of the newly joined user equals to user’s name, api executes ‘hangup’ command.

I think it can be done, but what if 2 users have same names.

here is my code:
indent preformatted text by 4 spaces
var api = new JitsiMeetExternalAPI(domain, options);
let OldId = “”;
api.on(‘readyToClose’, () => {

	window.location.href="logout.php";
					});
					
	var participants = api.addEventListener('videoConferenceJoined' , function(localuserid){
	console.log(localuserid.id);
	console.log(localuserid.displayName);
	let data = {jitsiid: localuserid.id };
	const userAction = async () => {

const response = await fetch(‘call to your update database php jsp or anyother server side routine’, {
method: ‘POST’,
body:JSON.stringify(data)

});
const myJson = await response.json();

console.log(myJson.oldjitsiID);
OldId=myJson.oldjitsiID;

}
userAction();

setTimeout(() => {

if (OldId.length > 0 ) {
api.executeCommand(‘sendEndpointTextMessage’, OldId , ‘LogOut’);
}

} , 5000);
// send logout signal after 5 seconds // there is a reason for it,

}); 

var LogOutRoutine = api.addEventListener(‘endpointTextMessageReceived’, function(e) {

	if (e.data.eventData.text=='LogOut' ){ 
	api.executeCommand('hangup'); }
	
					});

there is an id field in JWT token->context->user
can we use that?

you can try it, I am not sure. It alos depends on whom you wants to logout the first user or second.
If you want to logout user who joined earlier, then you definitely need jitsi id , else how will you send logout message

I have the same problem, but because my CMS where I have jitsi integrated, does not allow users with same names, is there a setting in Jitsi that it would prevent user to join to a room which already has similar named user?