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(auth) open token auth URL in a new window on Electron

Saúl Ibarra Corretgé54436f97c159
diff --git a/react/features/app/getRouteToRender.web.ts b/react/features/app/getRouteToRender.web.ts
index ce14d3d4f1..e2028b7ee7 100644
--- a/react/features/app/getRouteToRender.web.ts
+++ b/react/features/app/getRouteToRender.web.ts
@@ -5,6 +5,7 @@ import { getTokenAuthUrl } from '../authentication/functions';
import { IStateful } from '../base/app/types';
import { isRoomValid } from '../base/conference/functions';
import { isSupportedBrowser } from '../base/environment/environment';
+import { browser } from '../base/lib-jitsi-meet';
import { toState } from '../base/redux/functions';
import Conference from '../conference/components/web/Conference';
import { getDeepLinkingPage } from '../deep-linking/functions';
@@ -48,9 +49,9 @@ function _getWebConferenceRoute(state: IReduxState) {
// if we have auto redirect enabled, and we have previously logged in successfully
// let's redirect to the auth url to get the token and login again
- if (config.tokenAuthUrl && config.tokenAuthUrlAutoRedirect
- && state['features/authentication'].tokenAuthUrlSuccessful
- && !state['features/base/jwt'].jwt && room) {
+ if (!browser.isElectron() && config.tokenAuthUrl && config.tokenAuthUrlAutoRedirect
+ && state['features/authentication'].tokenAuthUrlSuccessful
+ && !state['features/base/jwt'].jwt && room) {
route.href = getTokenAuthUrl(config, room);
return Promise.resolve(route);
diff --git a/react/features/authentication/actions.web.ts b/react/features/authentication/actions.web.ts
index d373a053de..0753b7a66c 100644
--- a/react/features/authentication/actions.web.ts
+++ b/react/features/authentication/actions.web.ts
@@ -1,6 +1,7 @@
import { maybeRedirectToWelcomePage } from '../app/actions.web';
import { IStore } from '../app/types';
import { openDialog } from '../base/dialog/actions';
+import { browser } from '../base/lib-jitsi-meet';
import { appendURLHashParam } from '../base/util/uri';
import {
@@ -87,11 +88,18 @@ export function openTokenAuthUrl(tokenAuthServiceUrl: string): any {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const redirect = () => {
// We have already shown the prejoin screen, no need to show it again after obtaining the token.
- window.location.href = appendURLHashParam(tokenAuthServiceUrl, 'skipPrejoin', 'true');
+ let url = appendURLHashParam(tokenAuthServiceUrl, 'skipPrejoin', 'true');
+
+ if (browser.isElectron()) {
+ url = appendURLHashParam(url, 'electron', 'true');
+ window.open(url, '_blank');
+ } else {
+ window.location.href = url;
+ }
};
// Show warning for leaving conference only when in a conference.
- if (getState()['features/base/conference'].conference) {
+ if (!browser.isElectron() && getState()['features/base/conference'].conference) {
dispatch(openDialog(LoginQuestionDialog, {
handler: () => {
// Give time for the dialog to close.