From 41a6cbd3fcf912b17a3c69f83596e3a6eacdb9a4 Mon Sep 17 00:00:00 2001 From: damencho Date: Thu, 18 Aug 2022 11:37:34 -0500 Subject: [PATCH] fix: Jwt context.features to work without context.user. Fixes #12005 --- react/features/base/jwt/middleware.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/react/features/base/jwt/middleware.js b/react/features/base/jwt/middleware.js index 4f45e28ae..2cc662511 100644 --- a/react/features/base/jwt/middleware.js +++ b/react/features/base/jwt/middleware.js @@ -150,8 +150,10 @@ function _setJWT(store, next, action) { action.tenant = context.tenant || sub || undefined; action.user = user; - user && _overwriteLocalParticipant( - store, { ...user, + const newUser = user ? { ...user } : {}; + + _overwriteLocalParticipant( + store, { ...newUser, features: context.features }); } }