Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(visitor): Checks for auth expired before redirecting to avoid jwt errors.

damenchoac48d1def2b8
diff --git a/react/features/app/actions.any.ts b/react/features/app/actions.any.ts
index 72b5341145..98b88e3cbc 100644
--- a/react/features/app/actions.any.ts
+++ b/react/features/app/actions.any.ts
@@ -150,8 +150,8 @@ export function maybeRedirectToTokenAuthUrl(
return dispatch(openTokenAuthUrl(tokenAuthServiceUrl));
})
- .catch(() => {
- failureCallback();
+ .catch(e => {
+ failureCallback(e);
});
return true;
diff --git a/react/features/base/conference/actions.any.ts b/react/features/base/conference/actions.any.ts
index 1aef889bb1..c384622d81 100644
--- a/react/features/base/conference/actions.any.ts
+++ b/react/features/base/conference/actions.any.ts
@@ -1,4 +1,6 @@
+import { maybeRedirectToTokenAuthUrl } from '../../app/actions.any';
import { IReduxState, IStore } from '../../app/types';
+import { isTokenAuthInline } from '../../authentication/functions.any';
import { readyToClose } from '../../mobile/external-api/actions';
import { transcriberJoined, transcriberLeft } from '../../transcribing/actions';
import { setIAmVisitor } from '../../visitors/actions';
@@ -1079,6 +1081,15 @@ export function redirect(vnode: string, focusJid: string, username: string) {
dispatch(conferenceWillInit());
logger.info(`Dispatching connect from redirect (visitor = ${Boolean(vnode)}).`);
+ // obtaining the new token just before joining the main room from a visitor one will work
+ // only when using inline auth and will not work when using redirection
+ if (isTokenAuthInline(getState()['features/base/config'])
+ && maybeRedirectToTokenAuthUrl(dispatch, getState, (e: Error) => {
+ logger.error('Token is expired and there was an error refreshing it.', e);
+ })) {
+ return;
+ }
+
return dispatch(connect());
})
.then(() => {