fix(visitors): Fixes going live when the meeting is created. (#14905)
* fix(visitors): Fixes going live when first moderator joins.
* squash(jwt): Drop unused field.
* squash(jwt): Fixes loading token_util for visitors component.
* squash(jwt): Validate nbf if it exists as it is optional.
* squash(visitors): Keep prefer visitor state for not live meetings.
* squash(visitors): Automatically go live only when there is a moderator in the meeting.
* squash(visitors): Automatically go live only when there is an occupant in the meeting.
* squash(visitors): Drops a debug log.
* squash(visitors): Makes sure we first disconnect before attempting a reconnect.
If the reconnect happens too quickly, before being disconnected and the conference is still not live we will detect that we are still connected and will skip connecting to visitors service, and in the next moment we will disconnect.
* squash(visitors): Slow down successful reconnects.
If a meeting was just live but was destroyed jicofo will return it is not live, but service will return that it just got live. Slows down reconnects and at some point the service will return that the meeting is not live. The drawback is that it will take some time to connect when the meeting is created and back live.
* squash(visitors): Randomize the delay up to the available value.
getJwtDisabledButtons which is used as a selector will create a new array every time it is called. This will lead to unneccessary rerenders on every action where there is no difference in the result of getJwtDisabledButtons because the reference of the array will be different.
feat: move jwt to URL hash from search parameters (#14749)
* feat: move jwt to URL hash from search parameters
* fix lint
* comments for future work
* comment format
* fix to use ts-ignore like previous parseURLParams case
feat: Check jwt expiration and redirects to auth url if any. (#13879)
* feat: Check jwt expiration and redirects to auth url if any.
It may happen that the jwt had expired while being in the meeting and there is a network issue requiring to reload.
* squash: Fixes lint error.
* squash: Fixes comments.
feat(jwt) deprecate and remove enableFeaturesBasedOnToken
The new behavior is as follows:
IF a user has a token and `features` is not set, we treat it as if the
feature was enabled.
IF a user has a token and `features` is set, we check if the feature
name has a value of "true".
`isJwtFeatureEnabled` also provides a way to specify the default value
in case there is no token.
The counterpart of the external API in the Jitsi Meet Web app uses the
search URL param jwt to heuristically detect that the Web app is very
likely embedded (as an iframe) and, consequently, needs to forcefully
enable itself. It was looking at whether there was a JSON Web Token
(JWT) but that logic got broken when the JWT support was rewritten
because the check started happening before the search URL param jwt was
parsed.