JIGASI - Authenticated Domain + Google Transcribe + Closed Captions Error When Room Given Password Before CC Started

I have been running Jitsi + Domain Authentication + Jibri + Jigasi for a while now. Just ran into this error -

SEVERE: [59] impl.protocol.jabber.ChatRoomJabberImpl.joinAs().754 Failed to join chat room with nickname: <>. The chat room requests a password.

This reminds me of an issue with getting Jibri to work with Domain Authentication and a room password is set ( Jibri - Authenticating if a room has a password added by moderator - Install & Config / Record & stream - Jibri - Jitsi Community Forum - developers & users)

Is a solution to edit & do similar to

if user==‘recorder’ and domain==‘recorder.my.domain’

with the transcriber user defined ?

OK so I answered my own issue here, so I thought I’d add the solution for others -

I have mod_muc_jibrirecord_pwd.lua in /usr/lib/prosody/modules/

local MUC_NS = "http://jabber.org/protocol/muc";
local jid = require "util.jid";
module:hook("muc-occupant-pre-join", function (event)
    local room, stanza = event.room, event.stanza;

    local user, domain, res = jid.split(event.stanza.attr.from);
    log("info", "--------------> user %s domain %s res %s pass %s", tostring(user),tostring(domain),tostring(res),tostring(room:get_password())); 

    if user=='recorder' and domain=='recorder.meet.domain.com' then
      local join = stanza:get_child("x", MUC_NS);
      join:tag("password", { xmlns = MUC_NS }):text(room:get_password());
    end;
    if user=='transcriber' and domain=='recorder.meet.domain.com' then
      local join = stanza:get_child("x", MUC_NS);
      join:tag("password", { xmlns = MUC_NS }):text(room:get_password());
    end;	
end);

I added the following to the section Component “internal.auth.meet.domain.com” “muc”

   modules_enabled = {
      "ping";
      "muc_jibrirecord_pwd";
    }