Passcode functionality is not working


I am working with JitsiMeetExternalAPI
and I have created a passcode functionality for participants who join my meeting using a link.

I have tried to do this functionality using the below code as per the online suggestion but have not gotten the expected result

api.addEventListener('participantRoleChanged', function (event) {
        if (event.role === 'moderator' || meeting?.IsSecured) {
          api.executeCommand('password', pass);
        } else {
          setTimeout(() => {
            api.addEventListener('passwordRequired', () => {
              api.executeCommand('password', pass);

            api.addEventListener('videoConferenceJoined', () => {
              setTimeout(function () {
                api.executeCommand('password', pass);
              }, 300);
          }, 15);

Sometimes the passcode model is open, sometimes participants join the meeting without entering the passcode.

This code is subject to timing issues indeed. You can’t guarantee Jitsi won’t be faster and open the password dialog.

Perhaps you could use the lobby to let participants in instead?

@saghul thank you for the quick response,

I think this is not a timing issue,
because I stopped the meeting and restarted it then the passcode model opened for the participants

actually, I am new with the jitsi and I don’t have any idea how to add a lobby for participants and passcode things

@saghul also as per your suggestion, I try with the lobby feature but if a participant requests to join the meeting so
the moderator does not get any notification and in the console, the following error occurred.

Missing lobbyRoomJid, cannot join lobby room. 

Are you doing your own deployment?

no, I am not using my own deployment, I am using the 8x8 default script.

@saghul can you please help me out with this?

Are you a JaaS customer? If so please open a support ticket. There are some specific things that apply only to JaaS and not the standard Jitsi Meet.

@saghul ok thank you for your time,
is there any other way to do passcode functionality without using the lobby feature