From 3438e5d56a7c50e8d9ef706a86f01bbb5f245e3d Mon Sep 17 00:00:00 2001 From: damencho Date: Wed, 9 Oct 2024 14:54:04 -0500 Subject: [PATCH] fix(jwt): Fix initial value of features in jaas mode. The backend initializes them as all missing, this way we sync backend and UI. --- react/features/base/jwt/functions.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/react/features/base/jwt/functions.ts b/react/features/base/jwt/functions.ts index 64b3d70cb6d..856fcaf4aa1 100644 --- a/react/features/base/jwt/functions.ts +++ b/react/features/base/jwt/functions.ts @@ -2,6 +2,7 @@ import jwtDecode from 'jwt-decode'; import { IReduxState } from '../../app/types'; +import { isVpaasMeeting } from '../../jaas/functions'; import { getLocalParticipant } from '../participants/functions'; import { IParticipantFeatures } from '../participants/types'; import { parseURLParams } from '../util/parseURLParams'; @@ -50,7 +51,12 @@ export function getJwtName(state: IReduxState) { */ export function isJwtFeatureEnabled(state: IReduxState, feature: string, ifNoToken: boolean, ifNotInFeatures: boolean) { const { jwt } = state['features/base/jwt']; - const { features } = getLocalParticipant(state) || {}; + let { features } = getLocalParticipant(state) || {}; + + if (typeof features === 'undefined' && isVpaasMeeting(state)) { + // for vpaas the backend is always initialized with empty features if those are missing + features = {}; + } return isJwtFeatureEnabledStateless({ jwt,