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(jwt): Fixes parsing JWT in hash as JSON instead of a string (#14760)

Aaron van Meerten2ed0418bd954
diff --git a/react/features/base/jwt/functions.ts b/react/features/base/jwt/functions.ts
index 02c7d62228..5583b31cda 100644
--- a/react/features/base/jwt/functions.ts
+++ b/react/features/base/jwt/functions.ts
@@ -19,7 +19,7 @@ import logger from './logger';
*/
export function parseJWTFromURLParams(url: URL | typeof window.location = window.location) {
// @ts-ignore
- const jwt = parseURLParams(url, true, 'hash').jwt;
+ const jwt = parseURLParams(url, false, 'hash').jwt;
// TODO: eventually remove the search param and only pull from the hash
// @ts-ignore
diff --git a/react/features/base/util/uri.ts b/react/features/base/util/uri.ts
index 9c89c991e5..34f86b12a8 100644
--- a/react/features/base/util/uri.ts
+++ b/react/features/base/util/uri.ts
@@ -564,9 +564,9 @@ export function urlObjectToString(o: { [key: string]: any; }): string | undefine
if (jwt) {
if (hash.length) {
- hash = `${hash}&jwt=${jwt}`;
+ hash = `${hash}&jwt=${JSON.stringify(jwt)}`;
} else {
- hash = `#jwt=${jwt}`;
+ hash = `#jwt=${JSON.stringify(jwt)}`;
}
}