mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
The counterpart of the external API in the Jitsi Meet Web app uses the search URL param jwt to heuristically detect that the Web app is very likely embedded (as an iframe) and, consequently, needs to forcefully enable itself. It was looking at whether there was a JSON Web Token (JWT) but that logic got broken when the JWT support was rewritten because the check started happening before the search URL param jwt was parsed.
17 lines
510 B
JavaScript
17 lines
510 B
JavaScript
/* @flow */
|
|
|
|
import { parseURLParams } from '../base/config';
|
|
|
|
/**
|
|
* Retrieves the JSON Web Token (JWT), if any, defined by a specific
|
|
* {@link URL}.
|
|
*
|
|
* @param {URL} url - The {@code URL} to parse and retrieve the JSON Web Token
|
|
* (JWT), if any, from.
|
|
* @returns {string} The JSON Web Token (JWT), if any, defined by the specified
|
|
* {@code url}; otherwise, {@code undefined}.
|
|
*/
|
|
export function parseJWTFromURLParams(url: URL = window.location) {
|
|
return parseURLParams(url, true, 'search').jwt;
|
|
}
|