Jitsi JWT settings trying again.

This commit is contained in:
Scott Idem
2025-12-02 17:17:19 -05:00
parent 8891a51c2e
commit 1a315483eb

View File

@@ -229,6 +229,11 @@ class JitsiTokenRequest(BaseModel):
name: str = Field(..., description="The display name of the user.") name: str = Field(..., description="The display name of the user.")
email: EmailStr = Field(..., description="The email of the user.") email: EmailStr = Field(..., description="The email of the user.")
is_moderator: bool = Field(..., description="Whether the user should be a moderator.") is_moderator: bool = Field(..., description="Whether the user should be a moderator.")
# Optional settings for the Jitsi meeting
settings: Optional[Dict[str, Union[bool, int]]] = Field(
None,
description="Optional settings for the Jitsi meeting, such as startAudioMuted, startVideoMuted, etc."
)
# A simple endpoint to generate the Jitsi-specific JWT # A simple endpoint to generate the Jitsi-specific JWT
@router.post("/jitsi_token") @router.post("/jitsi_token")
@@ -260,17 +265,20 @@ async def create_jitsi_jwt(
"email": request_data.email, "email": request_data.email,
"moderator": "true" if request_data.is_moderator else "false" "moderator": "true" if request_data.is_moderator else "false"
}, },
"settings": { "settings": request_data.settings if hasattr(request_data, 'settings') else None,
# "disableAudioLevels": False,
# "startAudioMuted": request_data.settings.startAudioMuted, # {
# "startVideoMuted": request_data.settings.startVideoMuted, # "disableAudioLevels": False,
"startMuted": request_data.settings.startMuted, # "startAudioMuted": request_data.settings.startAudioMuted,
"startHidden": request_data.settings.startHidden, # "startVideoMuted": request_data.settings.startVideoMuted,
"followMe": request_data.settings.followMe, # "startMuted": request_data.settings.startMuted,
"reactionsMuted": request_data.settings.reactionsMuted # "startHidden": request_data.settings.startHidden,
}, # "followMe": request_data.settings.followMe,
# "reactionsMuted": request_data.settings.reactionsMuted
# }
} }
} }
log.debug(payload)
# Sign the JWT with your secret key # Sign the JWT with your secret key
# The algorithm must be the same as configured in your Prosody setup (HS256) # The algorithm must be the same as configured in your Prosody setup (HS256)