From 0ab905bf756e8bac6287f629c040cec62717716e Mon Sep 17 00:00:00 2001 From: Tudor-Ovidiu Avram Date: Thu, 15 Jul 2021 12:09:03 +0300 Subject: [PATCH] code review --- react/features/jaas/middleware.web.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/react/features/jaas/middleware.web.js b/react/features/jaas/middleware.web.js index 7783178f2..1e7bfb012 100644 --- a/react/features/jaas/middleware.web.js +++ b/react/features/jaas/middleware.web.js @@ -3,16 +3,12 @@ import { CONFERENCE_JOINED } from '../base/conference/actionTypes'; import { CONNECTION_FAILED } from '../base/connection'; import { JitsiConnectionErrors } from '../base/lib-jitsi-meet'; import { MiddlewareRegistry } from '../base/redux'; +import { isVpaasMeeting } from '../billing-counter/functions'; import { SET_DETAILS } from './actionTypes'; import { getCustomerDetails } from './actions'; import { STATUSES } from './constants'; -const redirectErrors = [ - JitsiConnectionErrors.CONNECTION_DROPPED_ERROR, - JitsiConnectionErrors.PASSWORD_REQUIRED -]; - /** * The redux middleware for jaas. * @@ -29,7 +25,15 @@ MiddlewareRegistry.register(store => next => async action => { case CONNECTION_FAILED: { const { error } = action; - if (error && redirectErrors.includes(error.name)) { + if (!isVpaasMeeting(store.getState()) || !error) { + break; + } + + if (error.name === JitsiConnectionErrors.PASSWORD_REQUIRED) { + if (error.message !== 'could not obtain public key') { + break; + } + store.dispatch(redirectToStaticPage('/static/planLimit.html')); } break;