Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix: Fixes #10796 authentication in conference. (#10848)
Дамян Минков43ab8e3ca8e6
diff --git a/react/features/authentication/components/native/LoginDialog.js b/react/features/authentication/components/native/LoginDialog.jsindex 105982f3be..4ab7612aad 100644--- a/react/features/authentication/components/native/LoginDialog.js+++ b/react/features/authentication/components/native/LoginDialog.js@@ -337,7 +337,7 @@ function _mapStateToProps(state) {progress,thenableWithCancel} = state['features/authentication'];- const { authRequired } = state['features/base/conference'];+ const { authRequired, conference } = state['features/base/conference'];const { hosts: configHosts } = state['features/base/config'];const {connecting,@@ -346,7 +346,7 @@ function _mapStateToProps(state) {return {..._abstractMapStateToProps(state),- _conference: authRequired,+ _conference: authRequired || conference,_configHosts: configHosts,_connecting: Boolean(connecting) || Boolean(thenableWithCancel),_error: connectionError || authenticateAndUpgradeRoleError,diff --git a/react/features/authentication/components/web/LoginDialog.js b/react/features/authentication/components/web/LoginDialog.jsindex 775da1a370..d5bd2eddbd 100644--- a/react/features/authentication/components/web/LoginDialog.js+++ b/react/features/authentication/components/web/LoginDialog.js@@ -299,7 +299,7 @@ function mapStateToProps(state) {progress,thenableWithCancel} = state['features/authentication'];- const { authRequired } = state['features/base/conference'];+ const { authRequired, conference } = state['features/base/conference'];const { hosts: configHosts } = state['features/base/config'];const {connecting,@@ -307,7 +307,7 @@ function mapStateToProps(state) {} = state['features/base/connection'];return {- _conference: authRequired,+ _conference: authRequired || conference,_configHosts: configHosts,_connecting: connecting || thenableWithCancel,_error: connectionError || authenticateAndUpgradeRoleError,diff --git a/react/features/authentication/middleware.native.js b/react/features/authentication/middleware.native.jsindex c67be2889d..3f0a8a5c6a 100644--- a/react/features/authentication/middleware.native.js+++ b/react/features/authentication/middleware.native.js@@ -19,6 +19,7 @@ import { MiddlewareRegistry } from '../base/redux';import {CANCEL_LOGIN,STOP_WAIT_FOR_OWNER,+ UPGRADE_ROLE_FINISHED,WAIT_FOR_OWNER} from './actionTypes';import {@@ -61,10 +62,15 @@ MiddlewareRegistry.register(store => next => action => {// Go back to the app's entry point._hideLoginDialog(store);- // FIXME Like cancelWaitForOwner, dispatch conferenceLeft to notify- // the external-api.+ const { authRequired, conference } = getState()['features/base/conference'];- dispatch(appNavigate(undefined));+ // Only end the meeting if we are not already inside and trying to upgrade.+ if (authRequired && !conference) {+ // FIXME Like cancelWaitForOwner, dispatch conferenceLeft to notify+ // the external-api.++ dispatch(appNavigate(undefined));+ }}break;}@@ -123,6 +129,15 @@ MiddlewareRegistry.register(store => next => action => {store.dispatch(hideDialog(WaitForOwnerDialog));break;+ case UPGRADE_ROLE_FINISHED: {+ const { error, progress } = action;++ if (!error && progress === 1) {+ _hideLoginDialog(store);+ }+ break;+ }+case WAIT_FOR_OWNER: {_clearExistingWaitForOwnerTimeout(store);diff --git a/react/features/authentication/middleware.web.js b/react/features/authentication/middleware.web.jsindex c43738fcb1..184317592b 100644--- a/react/features/authentication/middleware.web.js+++ b/react/features/authentication/middleware.web.js@@ -16,6 +16,7 @@ import { MiddlewareRegistry } from '../base/redux';import {CANCEL_LOGIN,STOP_WAIT_FOR_OWNER,+ UPGRADE_ROLE_FINISHED,WAIT_FOR_OWNER} from './actionTypes';import {@@ -39,16 +40,23 @@ MiddlewareRegistry.register(store => next => action => {switch (action.type) {case CANCEL_LOGIN: {+ const { dispatch, getState } = store;+if (!isDialogOpen(store, WaitForOwnerDialog)) {if (_isWaitingForOwner(store)) {- store.dispatch(openWaitForOwnerDialog());+ dispatch(openWaitForOwnerDialog());return next(action);}- store.dispatch(hideLoginDialog());+ dispatch(hideLoginDialog());++ const { authRequired, conference } = getState()['features/base/conference'];- store.dispatch(maybeRedirectToWelcomePage());+ // Only end the meeting if we are not already inside and trying to upgrade.+ if (authRequired && !conference) {+ dispatch(maybeRedirectToWelcomePage());+ }}break;}@@ -91,6 +99,15 @@ MiddlewareRegistry.register(store => next => action => {store.dispatch(hideDialog(WaitForOwnerDialog));break;+ case UPGRADE_ROLE_FINISHED: {+ const { error, progress } = action;++ if (!error && progress === 1) {+ store.dispatch(hideLoginDialog());+ }+ break;+ }+case WAIT_FOR_OWNER: {_clearExistingWaitForOwnerTimeout(store);