Skip to content

Commit

Permalink
fix(jwt): Fix initial value of features in jaas mode.
Browse files Browse the repository at this point in the history
The backend initializes them as all missing, this way we sync backend and UI.
  • Loading branch information
damencho committed Oct 9, 2024
1 parent 176e409 commit 3438e5d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion react/features/base/jwt/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3438e5d

Please sign in to comment.