Skip to content

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

feat: move jwt to URL hash from search parameters (#14749)

Aaron van Meerten43ae5915a6f1
diff --git a/react/features/base/jwt/functions.ts b/react/features/base/jwt/functions.ts
index a500103ade..02c7d62228 100644
--- a/react/features/base/jwt/functions.ts
+++ b/react/features/base/jwt/functions.ts
@@ -19,7 +19,11 @@ import logger from './logger';
*/
export function parseJWTFromURLParams(url: URL | typeof window.location = window.location) {
// @ts-ignore
- return parseURLParams(url, true, 'search').jwt;
+ const jwt = parseURLParams(url, true, 'hash').jwt;
+
+ // TODO: eventually remove the search param and only pull from the hash
+ // @ts-ignore
+ return jwt ? jwt : parseURLParams(url, true, 'search').jwt;
}
/**
diff --git a/react/features/base/util/uri.ts b/react/features/base/util/uri.ts
index 02a86a08ba..9c89c991e5 100644
--- a/react/features/base/util/uri.ts
+++ b/react/features/base/util/uri.ts
@@ -537,6 +537,7 @@ export function urlObjectToString(o: { [key: string]: any; }): string | undefine
const search = new URLSearchParams(url.search);
+ // TODO: once all available versions are updated to support the jwt in the hash, remove this
if (jwt) {
search.set('jwt', jwt);
}
@@ -561,6 +562,14 @@ export function urlObjectToString(o: { [key: string]: any; }): string | undefine
let { hash } = url;
+ if (jwt) {
+ if (hash.length) {
+ hash = `${hash}&jwt=${jwt}`;
+ } else {
+ hash = `#jwt=${jwt}`;
+ }
+ }
+
for (const urlPrefix of [ 'config', 'iceServers', 'interfaceConfig', 'devices', 'userInfo', 'appData' ]) {
const urlParamsArray
= _objectToURLParamsArray(