Files
jitsi-meet/react/features/jwt/functions.js
Lyubo Marinov 320e67baa1 Fix the initialization of the (external) API
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.
2017-05-30 09:38:18 -05:00

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;
}