fix(jwt): Fix initial value of features in jaas mode.

The backend initializes them as all missing, this way we sync backend and UI.
This commit is contained in:
damencho
2024-10-09 14:54:04 -05:00
committed by Дамян Минков
parent 176e409af5
commit 3438e5d56a

View File

@@ -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,