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

* feat: move jwt to URL hash from search parameters

* fix lint

* comments for future work

* comment format

* fix to use ts-ignore like previous parseURLParams case
pull/14758/head jitsi-meet_9507
Aaron van Meerten 1 year ago committed by GitHub
parent 7c22bcf827
commit 43ae5915a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      react/features/base/jwt/functions.ts
  2. 9
      react/features/base/util/uri.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;
}
/**

@ -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(

Loading…
Cancel
Save